Skip to content

fix(policy): import live repositories and protect inventory - #51

Closed
donbeave wants to merge 2 commits into
mainfrom
fix/import-live-jackin-policy
Closed

donbeave wants to merge 2 commits into
mainfrom
fix/import-live-jackin-policy

Conversation

@donbeave

@donbeave donbeave commented Oct 5, 2026

Copy link
Copy Markdown
Member

This change adopts the nine existing GitHub repositories and their 18 rulesets through provider-documented import blocks, so an empty local state no longer plans duplicate creates. Every inventory entry now receives repository settings plus both rulesets; the settings-only disposition has been removed. Repository visibility is explicitly managed from the inventory, required CI contexts cannot be empty, and both rulesets depend on the managed repository resource.

Validation: tofu fmt -check -recursive and bash tests/verify-policy.sh pass. A fresh provider-backed plan from empty local state reports 27 imports and 27 no-op resource actions, with zero creates, updates, or destroys. No apply has been run. This repository uses the default local backend (tofu init -backend=false in CI); no remote backend was introduced.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T16:53:13.553616Z a86c868 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a86c8682e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread imports.tf
}

import {
to = module.repository_policy.github_repository.managed_settings["jackin-marketplace"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter imports to the configured inventory

When repository_policies is overridden to the eight repositories accepted by mandatory_target_repositories_present, the module's for_each creates no jackin-marketplace instance, but this unconditional import still targets one, causing tofu plan to fail instead of managing that otherwise-valid inventory. OpenTofu requires every import target to have corresponding resource configuration (OpenTofu import documentation); make these marketplace imports conditional on the configured keys or require marketplace in the inventory.

Useful? React with 👍 / 👎.

@donbeave

Copy link
Copy Markdown
Member Author

Three-root layout retained; salvage noted in unification plan (imports.tf pattern + inventory-guards, minus verify-policy.sh stages). Closing unmerged.

@donbeave donbeave closed this Oct 11, 2026
@donbeave
donbeave deleted the fix/import-live-jackin-policy branch October 11, 2026 08:48
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.

1 participant