Skip to content

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

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

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

Conversation

@nicktrn

@nicktrn nicktrn commented May 14, 2026

Copy link
Copy Markdown

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! 🚀

@robert-crandall

Copy link
Copy Markdown
Contributor

Thanks for putting this PR together and taking the time to contribute!

We're temporarily moving to an issue-first model (see CONTRIBUTING.md) where only collaborators can open PRs while we work through the backlog. Because of that, I'm going to close this PR for now.

I've linked it on #3501 so we don't lose your work or context when we pick that issue up. Feel free to add a 👍 or any extra notes there to help us prioritize it.

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.

2 participants