Skip to content

fix: load pytest configuration in CI container tests - #35

Merged
sprahasingh merged 3 commits into
mainfrom
fix/ci-pytest-config
Oct 8, 2026
Merged

sprahasingh merged 3 commits into
mainfrom
fix/ci-pytest-config

Conversation

@sprahasingh

Copy link
Copy Markdown
Owner

No description provided.

@codelens-gh

codelens-gh Bot commented Oct 8, 2026

Copy link
Copy Markdown

CodeLens Pre-Review Analysis

Outcome: Completed with historically grounded findings

7 hunks scanned · 12 similar past patterns matched

Historically grounded findings


Finding 1: GitHub Actions are referenced by tag versions instead of pinned commit SHAs

Location: .github/workflows/production.yml · line 101
Model confidence (uncalibrated): 90% | What to verify: Update action uses (e.g., actions/checkout@v7.0.1, actions/setup-python@v7.0.0, docker/login-action@v4.6.0) to pin to a specific commit SHA

Your code (this PR):

          "$IMAGE" python -m pytest -q -p no:cacheprovider -c /tmp/pytest.ini /tmp/codelens-tests

Evidence: Past reviewers flagged unpinned action references as a security issue in similar workflow files

Past reviews that triggered this (2 matches):

Similarity Source repository File Reviewer comment Link
85% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view
84% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view

Finding 2: GitHub Actions are referenced by version tags instead of pinned commit SHAs, which violates the repository’s security policy

Location: .github/workflows/production.yml · line 92
Model confidence (uncalibrated): 95% | What to verify: Pin each action (e.g., actions/checkout, actions/setup-python, docker/login-action) to a specific commit SHA or digest

Your code (this PR):

          --volume "$GITHUB_WORKSPACE/pytest.ini:/tmp/pytest.ini:ro"

Evidence: Past reviewers flagged unpinned action references in similar workflow files (comments [1] and [2])

Past reviews that triggered this (2 matches):

Similarity Source repository File Reviewer comment Link
84% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view
83% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view

Generated by CodeLens. Historically grounded findings cite their source reviews; general analysis is labeled separately.

General change overview (not historical evidence)

Changed areas (1 files; +24/-16 lines):

  • .github/workflows/production.yml (+24/-16)
    Validation: No test file is present in this diff. Run the existing tests that cover the changed areas before merging.

@codelens-gh

codelens-gh Bot commented Oct 8, 2026

Copy link
Copy Markdown

CodeLens Pre-Review Analysis

Outcome: Completed with historically grounded findings

1 hunk scanned · 5 similar past patterns matched

Historically grounded findings


Finding 1: The Docker actions are referenced by version tag instead of a commit SHA, leaving them unpinned

Location: .github/workflows/production.yml · line 52
Model confidence (uncalibrated): 90% | What to verify: Pin the docker/setup-buildx-action and docker/build-push-action to a specific commit SHA

Your code (this PR):

      - name: Set up Buildx for pull request image test
        if: github.event_name == 'pull_request'
        uses: docker/setup-buildx-action@v4.3.0
      - name: Build production image for pull request test only
        if: github.event_name == 'pull_request'
        uses: docker/build-push-action@v7.3.0
        with:
          context: .
... (25 more lines)

Evidence: Past reviews flagged similar unpinned action references (comments [0] and [2])

Past reviews that triggered this (2 matches):

Similarity Source repository File Reviewer comment Link
84% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view
84% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view

Generated by CodeLens. Historically grounded findings cite their source reviews; general analysis is labeled separately.

General change overview (not historical evidence)

Changed areas (1 files; +33/-0 lines):

  • .github/workflows/production.yml (+33/-0)
    Validation: No test file is present in this diff. Run the existing tests that cover the changed areas before merging.

@codelens-gh

codelens-gh Bot commented Oct 8, 2026

Copy link
Copy Markdown

CodeLens Pre-Review Analysis

Outcome: Completed with historically grounded findings

2 hunks scanned · 10 similar past patterns matched

Historically grounded findings

Suggested checks from historical patterns

These are speculative checks, not asserted defects.


Finding 1: GitHub Actions are referenced by version tags instead of pinned commit hashes

Location: .github/workflows/production.yml · line 52
Model confidence (uncalibrated): 95% | What to verify: Pin the actions (e.g., docker/setup-buildx-action, docker/build-push-action) to specific commit SHA hashes

Your code (this PR):

  image_test:
    name: Production image test (PR only, no publish)
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v7.0.1
... (4 more lines)

Evidence: Past reviewers flagged similar action references as unpinned to a hash in comments [0] and [1]

Past reviews that triggered this (2 matches):

Similarity Source repository File Reviewer comment Link
83% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view
83% tiangolo/fastapi .github/workflows/run-tests.yml "## zizmor / unpinned action reference: action is not pinned to a hash (required by blank..." view

Suggested check 2: Removing the if: github.event_name == 'pull_request' from the “Run full suite inside pull request image” step may cause the step to execute on push events, leading to unnecessary work or failures on fork pushes

Location: .github/workflows/production.yml · line 77
Model confidence (uncalibrated): 82% | What to verify: Confirm whether the step should be limited to PR events only and, if so, re‑add the appropriate if condition or adjust the workflow triggers

Evidence: Past reviewers noted that using only pull_request doesn’t cover pushes from forks and can cause CI to run unexpectedly

Past reviews that triggered this (2 matches):

Similarity Source repository File Reviewer comment Link
84% encode/httpx .github/workflows/test-suite.yml "Yeah, happy to revert it. It just means next time I'll either make my changes directly on ..." view
84% encode/httpx .github/workflows/test-suite.yml "Usually I just open a pull request in my fork for CI if I need to test it before opening a..." view

Suggested check 3: The new image_test job is gated only by if: github.event_name == 'pull_request' and the workflow lacks a workflow_dispatch trigger, making it impossible to run the PR‑only image test manually

Location: .github/workflows/production.yml · line 77
Model confidence (uncalibrated): 78% | What to verify: Add a workflow_dispatch trigger to the workflow (or to the job) if manual invocation is desired

Evidence: Previous comments suggested adding a workflow_dispatch trigger to allow manual runs and to cover cases where pull_request alone isn’t sufficient

Past reviews that triggered this (2 matches):

Similarity Source repository File Reviewer comment Link
84% encode/httpx .github/workflows/test-suite.yml "Separately, we could add a workflow_dispatch trigger so it can be invoked on fork branch..." view
84% encode/httpx .github/workflows/test-suite.yml "Yeah, happy to revert it. It just means next time I'll either make my changes directly on ..." view

Generated by CodeLens. Historically grounded findings cite their source reviews; general analysis is labeled separately.

General change overview (not historical evidence)

Changed areas (1 files; +13/-6 lines):

  • .github/workflows/production.yml (+13/-6)
    Validation: No test file is present in this diff. Run the existing tests that cover the changed areas before merging.

@sprahasingh
sprahasingh merged commit ff26963 into main Oct 8, 2026
5 checks 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