Skip to content

fix(examples): stop tracking generated build output - #24

Merged
h3adex merged 1 commit into
stackitcloud:mainfrom
devpie:fix/untrack-generated-build-output
Sep 16, 2026
Merged

h3adex merged 1 commit into
stackitcloud:mainfrom
devpie:fix/untrack-generated-build-output

Conversation

@devpie

@devpie devpie commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

examples/opa-policy-reactive-agent/build/config.json is a build artifact, not source. 060-policies-config.tf writes it through a local_file resource on every terraform apply, so the checked-in copy was generated output that got committed by mistake in 71d9bfc.

Two consequences:

  • The committed copy carried the STACKIT project ID and the policy-engine service account address of the environment it was generated in.
  • Any terraform apply rewrote the file and left it as a spurious diff in the contributor's working tree.

This PR removes the file and adds build/ to .gitignore. The pattern has no leading slash, so it covers any build/ directory anywhere in the repo, not just this one.

Notes for reviewers

  • Nothing reads the file. The policy engine's config is rendered on the VM by cloud-init/policy-engine.yaml.tftpl through templatefile() (see 050-policy-engine-host.tf), and scripts/policy_runner.py reads /etc/stackit-policy-engine/config.json there. Removing the local artifact does not change the example; the next apply regenerates it.
  • Removing the file does not remove it from history. The values remain readable at commit 71d9bfc and have been public since that commit was mirrored to GitHub. Whether history needs a rewrite, or the service account needs rotating, is a decision for the maintainers and the account owner — this PR deliberately does not touch it.
  • The deleted file had mode 100755, an executable JSON file.
  • Verified locally: check_readme_tags.py, check_todos.py, generate_agents_md.py --check and the pre-commit hygiene hooks all pass. The ignore pattern was tested against build/ directories at two different depths, including one outside examples/.

Checklist

  • The CI pipeline passed successfully.

🤖 Generated with Claude Code

060-policies-config.tf writes build/config.json through a local_file
resource on every terraform apply, so the checked-in copy was a build
artifact. It carried the project ID and service account email of the
environment it was generated in, and any apply left it as a spurious
diff.

Ignore build/ repository-wide so no example or module can commit
generated output again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@h3adex

h3adex commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Thx!

@h3adex
h3adex merged commit 09d4539 into stackitcloud:main Sep 16, 2026
5 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.

2 participants