Skip to content

fix(github_repository): wire code_security in security_and_analysis read/write#3431

Open
nicktrn wants to merge 1 commit into
integrations:mainfrom
nicktrn:fix/security-and-analysis-code-security
Open

fix(github_repository): wire code_security in security_and_analysis read/write#3431
nicktrn wants to merge 1 commit into
integrations:mainfrom
nicktrn:fix/security-and-analysis-code-security

Conversation

@nicktrn
Copy link
Copy Markdown

@nicktrn nicktrn commented May 14, 2026

PR #2935 added the code_security schema block. Neither read nor write paths were extended to handle it.

Effect:

  • write: code_security { status = ... } in config is silently dropped
  • read: code_security never populated in state on refresh -> permanent + code_security diff on every plan

Fix mirrors existing advanced_security handling in both functions.

TestAccGithubRepositorySecurity (added in #2935) already asserts code_security. Was broken pre-fix. Passes post-fix.

Out of scope: secret_scanning_ai_detection, secret_scanning_non_provider_patterns. Schema exists from #2935 but go-github v86 lacks the types. Separate fix needed - go-github update first.

integrations#2935 added the code_security schema block but did not extend
calculateSecurityAndAnalysis (write) or flattenSecurityAndAnalysis (read)
to handle it. Effect: code_security declarations are silently dropped on
apply, and the field is never populated in state on refresh, producing a
permanent `+ code_security` diff on every plan.

Mirrors the existing advanced_security handling.

secret_scanning_ai_detection and secret_scanning_non_provider_patterns
are also affected by integrations#2935 but require go-github type additions, so they
are out of scope here.
@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@github-actions github-actions Bot added the Type: Bug Something isn't working as documented label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant