Skip to content

chore: regenerate code references types - #14

Merged
matthewelwell merged 1 commit into
mainfrom
chore/regenerate-code-references-types
Nov 30, 2026
Merged

matthewelwell merged 1 commit into
mainfrom
chore/regenerate-code-references-types

Conversation

@matthewelwell

Copy link
Copy Markdown
Contributor

Unblocks CI on #13, which was failing on Validate generated types are up to date for reasons unrelated to that PR.

What happened

make generate-code-references-types regenerates src/code_references/types.py from the live API schema, and the check diffs the result:

@curl -sSL https://api.flagsmith.com/api/v1/swagger.json | ... datamodel-codegen --output src/code_references/types.py
- name: Validate generated types are up to date
  run: |
    make generate-code-references-types
    git diff --exit-code

So it fails when the API changes, not when this repo does. api.flagsmith.com has since added a vcs_provider field to FeatureFlagCodeReferencesScan and reordered two others.

The last run on this repo was 2026-02-07. Nothing has exercised the check in nine months, so the drift accumulated silently and surfaced on the next PR to come along.

Safety

No behaviour change. The entire diff is inside FeatureFlagCodeReferencesScan, which is generated but never imported — CodeReferenceSubmit is the only type this repo uses, and it's unchanged:

src/code_references/cli/upload_code_references.py:8:from code_references.types import CodeReferenceSubmit
src/code_references/cli/scan_code_references.py:12:from code_references.types import CodeReferenceSubmit

The upload payload is built as a plain dict rather than through the TypedDict, so vcs_provider needs no code behind it. If the scanner should be sending vcs_provider, that's a separate change and someone closer to the API should make the call.

Verified locally: regenerated output matches CI's diff exactly, make lint passes, make test passes 29/29.

Worth considering

This check will keep ambushing whoever opens the next PR after a quiet spell. Either pin the schema (commit it, or pass a version) so regeneration is deterministic, or run the check on a schedule so drift is caught as its own alert rather than as a failure on an unrelated PR.

🤖 Generated with Claude Code

Brings src/code_references/types.py back in sync with the live Flagsmith
API schema, which has added a vcs_provider field to
FeatureFlagCodeReferencesScan and reordered two fields.

The check that caught this regenerates from api.flagsmith.com on every PR
and diffs the result, so it drifts whenever the API changes rather than
when this repo does. Nothing has run it since February, so the drift only
surfaced now.

No behaviour change: FeatureFlagCodeReferencesScan is generated but never
imported, and CodeReferenceSubmit, the only type this repo actually uses,
is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@matthewelwell
matthewelwell requested a review from a team as a code owner November 30, 2026 15:56
@matthewelwell
matthewelwell requested review from emyller and removed request for a team November 30, 2026 15:56

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Regenerates code-reference types from the live API schema; the diff only adds an optional vcs_provider field to a TypedDict that is not used by the repo, leaving CodeReferenceSubmit unchanged. Behavior is unaffected and the change is bounded.

Turn on auto-fix | Re-trigger cubic

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@a6af20b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main       #14   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         4           
  Lines           ?       112           
  Branches        ?         0           
========================================
  Hits            ?       112           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matthewelwell
matthewelwell merged commit 8c2bedf into main Nov 30, 2026
3 checks passed
@matthewelwell
matthewelwell deleted the chore/regenerate-code-references-types branch November 30, 2026 16:03
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