Skip to content

refactor: bump QPC_MIN_SERVER_VERSION to 2.5.0#407

Merged
infinitewarp merged 2 commits intomainfrom
min-version
Mar 10, 2026
Merged

refactor: bump QPC_MIN_SERVER_VERSION to 2.5.0#407
infinitewarp merged 2 commits intomainfrom
min-version

Conversation

@nicolearagao
Copy link
Copy Markdown
Member

@nicolearagao nicolearagao commented Mar 5, 2026

Remove per-subcommand min_server_version overrides from report deployments, details, download, and insights commands. Mixing old and new server/client is not supported, so all commands should use the single global QPC_MIN_SERVER_VERSION. Bump it from 2.4.0 to 2.5.0 to reflect the new APIs required by report show and list.

Relates to JIRA: DISCOVERY-1272

Summary by Sourcery

Align CLI minimum server version requirements with a single global value and update it to 2.5.0.

Enhancements:

  • Centralize min server version validation on the global QPC_MIN_SERVER_VERSION constant instead of per-report subcommand overrides.
  • Update the global CLI minimum supported server version from 2.4.0 to 2.5.0 to reflect new server API requirements.

@nicolearagao nicolearagao requested a review from a team as a code owner March 5, 2026 13:08
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 5, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Centralizes the minimum supported server version for all CLI commands on the global QPC_MIN_SERVER_VERSION constant and bumps it from 2.4.0 to 2.5.0, removing legacy per-command overrides in specific report subcommands.

Class diagram for centralized QPC_MIN_SERVER_VERSION usage

classDiagram
    class CliCommand {
        - req_headers
        - response
        - min_server_version : string
        + _validate_args()
    }

    class ReportDeploymentsCommand {
        - report_id
        + _validate_args()
    }

    class ReportDetailsCommand {
        - report_id
        + _validate_args()
    }

    class ReportDownloadCommand {
        - report_id
        + _validate_args()
    }

    class ReportInsightsCommand {
        - report_id
        + _insights_report_available(sources)
    }

    CliCommand <|-- ReportDeploymentsCommand
    CliCommand <|-- ReportDetailsCommand
    CliCommand <|-- ReportDownloadCommand
    CliCommand <|-- ReportInsightsCommand

    class QpcUtils {
        + QPC_MIN_SERVER_VERSION : string = "2.5.0"
    }

    QpcUtils ..> CliCommand : provides_min_server_version
Loading

File-Level Changes

Change Details Files
Centralize minimum server version validation on the global constant used by all CLI commands.
  • Clarified the comment on the CliCommand initializer to describe the single minimum server version requirement rather than per-API version updates
  • Ensured CliCommand continues to use QPC_MIN_SERVER_VERSION as the authoritative minimum server version
qpc/clicommand.py
Increase the globally required server version for the CLI to 2.5.0 to match new report APIs.
  • Updated the QPC_MIN_SERVER_VERSION constant from 2.4.0 to 2.5.0
qpc/utils.py
Remove report subcommand-specific minimum server version overrides so they all rely on the global minimum version.
  • Deleted the min_server_version override from the insights report command, allowing it to inherit the global minimum
  • Deleted the min_server_version override from the deployments report command, allowing it to inherit the global minimum
  • Deleted the min_server_version override from the details report command, allowing it to inherit the global minimum
  • Deleted the min_server_version override from the download report command, allowing it to inherit the global minimum
qpc/report/insights.py
qpc/report/deployments.py
qpc/report/details.py
qpc/report/download.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Now that min_server_version is centralized, scan for any remaining hard-coded server version strings in user-facing error messages or logic and replace them with QPC_MIN_SERVER_VERSION to avoid future drift.
  • Consider tightening the new comment on min_server_version to explicitly mention that any API changes requiring a newer server must be accompanied by a QPC_MIN_SERVER_VERSION bump, to preserve the previous guidance that was removed from CliCommand.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that min_server_version is centralized, scan for any remaining hard-coded server version strings in user-facing error messages or logic and replace them with QPC_MIN_SERVER_VERSION to avoid future drift.
- Consider tightening the new comment on min_server_version to explicitly mention that any API changes requiring a newer server must be accompanied by a QPC_MIN_SERVER_VERSION bump, to preserve the previous guidance that was removed from CliCommand.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@mirekdlugosz mirekdlugosz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what is happening in unit tests, but I think you should also remove all headers={"X-Server-Version": VERSION} from mocks (example).

I see only tests in qpc/tests/report/ set that, and it so happens that only tests in qpc/tests/report/ are failing CI. Although I have not checked that all failing tests have that headers set.

Also, personally I would not include QPC_MIN_SERVER_VERSION bump here. We routinely do that as part of new version release. Yes, I know jira ticket explicitly says that. I still think jira ticket mixes two different things and forces you to create a PR that can't be merged due to CI failures.

@infinitewarp infinitewarp force-pushed the min-version branch 2 times, most recently from 4a6ab40 to 5e28cda Compare March 9, 2026 21:24
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.04%. Comparing base (3a21f2b) to head (70f1a26).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
- Coverage   96.04%   96.04%   -0.01%     
==========================================
  Files         122      122              
  Lines        7772     7762      -10     
==========================================
- Hits         7465     7455      -10     
  Misses        307      307              

☔ View full report in Codecov by Sentry.
📢 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.

Remove per-subcommand min_server_version overrides from report
deployments, details, download, and insights commands. Mixing old
and new server/client is not supported, so all commands should use
the single global QPC_MIN_SERVER_VERSION. Bump it from 2.4.0 to
2.5.0 to reflect the new APIs required by report show and list.

Relates to JIRA: DISCOVERY-1272
@infinitewarp infinitewarp enabled auto-merge (rebase) March 10, 2026 20:23
@infinitewarp infinitewarp merged commit b73b6ec into main Mar 10, 2026
19 checks passed
@infinitewarp infinitewarp deleted the min-version branch March 10, 2026 20:43
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.

4 participants