Skip to content

Remove the silent two-library default from trigger-add-submodules.sh #65

Description

@whisper67265

Problem

scripts/trigger-add-submodules.sh silently defaulted to unordered, json when --submodules was omitted, so operator-triggered dispatches could diverge from raw API behavior. When submodules is omitted from a repository_dispatch payload sent via the GitHub API, the workflow auto-discovers the full library list from boostorg/boost .gitmodules via resolve_add_submodules_names — a behavior the script default masked.

Acceptance Criteria

  • trigger-add-submodules.sh exits with an error and usage text when --submodules is missing or empty
  • Documentation (GETTING-STARTED.md, endpoint-contract.md) states that --submodules is required on the script while the API field remains optional for auto-discovery
  • build_dispatch_json produces correct payloads under jq 1.7 (no collision with the built-in pairs function)
  • Bats tests cover trigger-dispatch-common.sh, trigger-add-submodules.sh, and trigger-start-translation.sh with a curl stub for repository_dispatch POSTs

Implementation Notes

  • Removed DEFAULT_SUBMODULES and the SUBMODULES="${SUBMODULES:-$DEFAULT_SUBMODULES}" fallback; added an explicit guard before dispatch
  • Renamed jq variable from pairs to kv_pairs in build_dispatch_json to avoid jq 1.7 built-in name collision
  • Added install_dispatch_curl_stub / extract_dispatch_request_body helpers in tests/helpers/http_mock.bash for offline dispatch testing

References

  • CHANGELOG.md
  • docs/GETTING-STARTED.md
  • docs/endpoint-contract.md
  • scripts/trigger-add-submodules.sh
  • scripts/trigger-dispatch-common.sh
  • tests/helpers/http_mock.bash
  • tests/test_getting_started.bats
  • tests/test_trigger_add_submodules.bats
  • tests/test_trigger_dispatch_common.bats
  • tests/test_trigger_start_translation.bats

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions