Skip to content

weblate endpoint and branch naming consolidation across 6 files#27

Merged
wpak-ai merged 2 commits into
cppalliance:masterfrom
whisper67265:fix/naming-consolidation
Jun 23, 2026
Merged

weblate endpoint and branch naming consolidation across 6 files#27
wpak-ai merged 2 commits into
cppalliance:masterfrom
whisper67265:fix/naming-consolidation

Conversation

@whisper67265

@whisper67265 whisper67265 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Close #24.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Updated workflows and helper scripts to use configurable branch prefixes and a configurable Weblate endpoint path (instead of hardcoded naming), including dynamic master-branch selection.
  • Documentation

    • Refreshed README, architecture notes, and endpoint-contract docs to reflect the new configurable branch model and Weblate POST URL construction.
  • Tests

    • Adjusted Bats test expectations and fixtures to match the configurable branch naming conventions and prefixes.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2d72797-f626-4a94-a6c7-deafbe4fb3b6

📥 Commits

Reviewing files that changed from the base of the PR and between 2b4f5ea and 9387cad.

📒 Files selected for processing (1)
  • tests/test_process_submodule.bats
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_process_submodule.bats

📝 Walkthrough

Walkthrough

Introduces three named constants — LOCAL_BRANCH_PREFIX, TRANSLATION_BRANCH_PREFIX, and WEBLATE_ENDPOINT_PATH — into .github/workflows/assets/env.sh and replaces every hardcoded local-, translation-, master, and boost-endpoint/add-or-update/ string across all workflow YAML files, shell libraries, trigger scripts, tests, and documentation.

Changes

Branch and endpoint naming consolidation

Layer / File(s) Summary
New constants in env.sh
.github/workflows/assets/env.sh
Defines LOCAL_BRANCH_PREFIX="local-", TRANSLATION_BRANCH_PREFIX="translation-", and WEBLATE_ENDPOINT_PATH="boost-endpoint/add-or-update/" as the single source of truth for branch naming and endpoint paths.
Shell library updates
.github/workflows/assets/lib.sh, .github/workflows/assets/translation.sh
has_open_translation_pr, ensure_local_branch_in_translations, finalize_translations_local, add_create_tag_workflow, and three functions in translation.sh now derive branch names from the prefix variables; add_create_tag_workflow additionally copies env.sh into target repos alongside create-tag.yml.
Workflow YAML consumer updates
.github/workflows/add-submodules.yml, .github/workflows/assets/create-tag.yml, .github/workflows/start-translation.yml, .github/workflows/sync-translation.yml
All four workflow files source env.sh (where possible) or use prefix variables to substitute LOCAL_BRANCH_PREFIX, TRANSLATION_BRANCH_PREFIX, MASTER_BRANCH, and WEBLATE_ENDPOINT_PATH for previously hardcoded strings; create-tag.yml includes comments aligning YAML literals with env.sh values.
Trigger scripts source env.sh
scripts/trigger-add-submodules.sh, scripts/trigger-start-translation.sh
Both scripts now source .github/workflows/assets/env.sh at startup so branch/endpoint constants are available during local invocation.
Test suite alignment
tests/helpers/common.bash, tests/test_lib.bats, tests/test_merge_guard.bats, tests/test_process_submodule.bats
Hardcoded MASTER_BRANCH="master" removed from common.bash; assertions and fixture setup in all three test files updated to reference MASTER_BRANCH, LOCAL_BRANCH_PREFIX, and TRANSLATION_BRANCH_PREFIX.
Documentation updates
README.md, docs/ARCHITECTURE.md, docs/endpoint-contract.md
All hardcoded branch and endpoint strings replaced with constant names throughout; new "Outbound Weblate" section added to endpoint-contract.md documenting the POST …/${WEBLATE_ENDPOINT_PATH} surface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • henry0816191
  • wpak-ai

🐰 A rabbit once typed local-en by hand,
Now LOCAL_BRANCH_PREFIX rules the land.
One env.sh to bind them all,
No more hard-coded strings to fall!
Hop, hop — the constants dance,
And every script gets a second chance. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the primary change: consolidating hardcoded Weblate endpoint and branch naming constants into a shared configuration file.
Linked Issues check ✅ Passed All four acceptance criteria from issue #24 are met: centralized constants defined in env.sh and used across workflows/scripts/tests, env.sh copied to mirror repos, start-translation.yml uses dynamic endpoint/branch, and documentation updated.
Out of Scope Changes check ✅ Passed All changes are directly in scope: replacing hardcoded literals with configurable constants across workflows, scripts, tests, and documentation as specified in issue #24.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_process_submodule.bats`:
- Around line 43-45: The mirror fixture setup fails when MASTER_BRANCH is not
"master" because the create_remote_branch call on line 45 attempts to use
MASTER_BRANCH as a base, but that remote branch was never created in the
mirror_bare repository first. After assigning mirror_bare on line 44, add a
create_remote_branch call to establish the MASTER_BRANCH in the mirror_bare repo
(similar to what is done for the boost fixture on line 41) before attempting to
create the dependent branch with the LOCAL_BRANCH_PREFIX.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e523c4a6-634e-4f0b-b384-e0be45233b82

📥 Commits

Reviewing files that changed from the base of the PR and between 785d9f9 and 2b4f5ea.

📒 Files selected for processing (16)
  • .github/workflows/add-submodules.yml
  • .github/workflows/assets/create-tag.yml
  • .github/workflows/assets/env.sh
  • .github/workflows/assets/lib.sh
  • .github/workflows/assets/translation.sh
  • .github/workflows/start-translation.yml
  • .github/workflows/sync-translation.yml
  • README.md
  • docs/ARCHITECTURE.md
  • docs/endpoint-contract.md
  • scripts/trigger-add-submodules.sh
  • scripts/trigger-start-translation.sh
  • tests/helpers/common.bash
  • tests/test_lib.bats
  • tests/test_merge_guard.bats
  • tests/test_process_submodule.bats
💤 Files with no reviewable changes (1)
  • tests/helpers/common.bash

Comment thread tests/test_process_submodule.bats
@whisper67265 whisper67265 self-assigned this Jun 23, 2026

@henry0816191 henry0816191 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@whisper67265 whisper67265 requested a review from wpak-ai June 23, 2026 17:52
@wpak-ai wpak-ai merged commit a62ee39 into cppalliance:master Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weblate endpoint and branch naming consolidation across 6 files

3 participants