Skip to content

fix(ci): use dummy key fallback so dependabot PRs pass test_parse_aws#45

Merged
O1ahmad merged 2 commits into
mainfrom
chore/add-mit-license
Jun 19, 2026
Merged

fix(ci): use dummy key fallback so dependabot PRs pass test_parse_aws#45
O1ahmad merged 2 commits into
mainfrom
chore/add-mit-license

Conversation

@O1ahmad

@O1ahmad O1ahmad commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

All 5 open dependabot PRs (#40#44) fail tests/test_parser.py::test_parse_aws with the same root cause: GitHub Actions withholds repository secrets from dependabot pull_request events, so OPENAI_API_KEY arrives as an empty string. The parser's non-empty-key guard then short-circuits before requests.post is ever called, returning [] subcommands instead of the expected 2.

Warning: OPENAI_API_KEY not set, skipping AI analysis
AssertionError: assert 0 == 2  # subcommands length

Fix

Use the || fallback operator to supply a literal placeholder key when the secret is absent. Since requests.post is fully mocked in the test suite, no real API call is made — the parser only needs a non-empty string to proceed past the guard.

OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'dummy-key-for-ci' }}

This is a pre-existing bug in the CI setup unrelated to any of the dependabot changes. Once this PR merges to main, the dependabot PRs can be rebased/re-run and will pass.

Affected PRs

Made with Cursor

O1ahmad and others added 2 commits June 19, 2026 13:32
GitHub withholds secrets from dependabot PRs, so OPENAI_API_KEY
arrived as an empty string. The parser's non-empty guard then
short-circuited before the mocked requests.post was ever called,
causing test_parse_aws to fail with 0 subcommands instead of 2.
Using a literal fallback lets the parser proceed while the test
mock handles the actual HTTP call.

Co-authored-by: Cursor <[email protected]>
requests 2.34.x requires Python >=3.10. The CI was still pinned to
3.9, causing pip to reject the version outright. Using 3.12 aligns
with the Dockerfile (3.14-slim bump in PR #44) and unblocks #42.

Co-authored-by: Cursor <[email protected]>
@O1ahmad O1ahmad merged commit 5ee2558 into main Jun 19, 2026
1 check 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.

1 participant