Skip to content

Commit 4a9fba4

Browse files
committed
docs: add CI/automation script change guardrails to AGENTS.md
1 parent 9b861da commit 4a9fba4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,19 @@ table: see [doc/build/JdkUpgrades.md](doc/build/JdkUpgrades.md).
437437
- All code needs to strive to be lean in terms of resources consumption and easy to follow -
438438
do not shy away from factoring out self containing code to shorter functions with explicit name
439439

440+
## CI / Automation Script Changes
441+
- Before rewriting or replacing a script invoked from `.gitlab-ci.yml`, `.gitlab/**/*.yml`, or any CI job,
442+
run `git log -p -- <script>` (or diff against the version being replaced) and enumerate every behavior
443+
branch it has — fallbacks, env-var-driven paths, error exits. Preserve all of them unless explicitly
444+
asked to drop one; do not silently narrow behavior while refactoring.
445+
- Grep the calling `.gitlab-ci.yml` / `.gitlab/**/*.yml` jobs for how the script is invoked (env vars set,
446+
exit codes expected) and confirm the rewrite still satisfies every caller, not just the common/local case.
447+
- When removing an item from a default list or config (an antagonist, a test tag, a feature flag), cite
448+
the exact file/line proving it is inert or unused in that context before removing it — never remove
449+
based on assumption alone.
450+
- After changing a CI-invoked script, run a syntax check (e.g. `bash -n <script>`) and trace through each
451+
CI job that calls it before considering the change complete.
452+
440453
### C/C++ Code Style
441454
- **Indentation**: Match the exact indentation style of the surrounding code in each file. Do not introduce inconsistent indentation — reviewers will flag it.
442455
- **Minimal complexity**: Do not split inline logic into separate helper functions unless the helpers are reused or the original is genuinely hard to follow. Unnecessary splits add indirection without value.

0 commit comments

Comments
 (0)