Skip to content

Add IRequestsParamsProvider to allow passing additional url params to…#81

Merged
kryksyh merged 1 commit into
musescore:mainfrom
kryksyh:add_irequestparamsprovider
Jun 10, 2026
Merged

Add IRequestsParamsProvider to allow passing additional url params to…#81
kryksyh merged 1 commit into
musescore:mainfrom
kryksyh:add_irequestparamsprovider

Conversation

@kryksyh

@kryksyh kryksyh commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Add IRequestsParamsProvider to allow passing additional url params to the update checker

  • I signed the CLA as username:
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@kryksyh
kryksyh requested a review from Eism June 10, 2026 08:00
@kryksyh kryksyh self-assigned this Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kryksyh, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 31 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2aae5f8f-836e-40b7-9145-94f67c0b8a96

📥 Commits

Reviewing files that changed from the base of the PR and between 38278e7 and b454fb4.

📒 Files selected for processing (4)
  • framework/update/CMakeLists.txt
  • framework/update/internal/appupdateservice.cpp
  • framework/update/internal/appupdateservice.h
  • framework/update/iupdaterequestparamsprovider.h
📝 Walkthrough

Walkthrough

This PR introduces a new global interface IRequestParamsProvider that exposes request parameters as string key/value pairs. The interface is registered in the global module's CMake target. AppUpdateService is updated with a dependency injection of IRequestParamsProvider and modified to augment its update-check URLs with query parameters sourced from the provider when available, using QUrlQuery to construct and apply the parameters.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing IRequestParamsProvider to allow passing additional URL parameters to the update checker.
Description check ✅ Passed The description includes all required checklist items completed, CLA signed, build configuration specified, and addresses the PR's objective.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@framework/update/internal/appupdateservice.cpp`:
- Around line 138-147: The code currently creates an empty QUrlQuery which
overwrites any existing query parameters on the QUrl `url`; change the
initialization to start from the existing URL so pre-existing parameters are
preserved (e.g., construct QUrlQuery from `url` or its existing query), then add
the provider params from `requestParamsProvider()->requestParams()` and call
`url.setQuery(query)` as before; update the block around
`requestParamsProvider()`, the `QUrlQuery query` initialization, and the loop
that adds items to reference that preserved-initialized `query`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 81b13a09-6cd8-466e-a702-22e9292de853

📥 Commits

Reviewing files that changed from the base of the PR and between 4fab538 and 38278e7.

📒 Files selected for processing (4)
  • framework/global/CMakeLists.txt
  • framework/global/irequestparamsprovider.h
  • framework/update/internal/appupdateservice.cpp
  • framework/update/internal/appupdateservice.h

Comment thread framework/update/internal/appupdateservice.cpp
@kryksyh
kryksyh force-pushed the add_irequestparamsprovider branch from 38278e7 to b454fb4 Compare June 10, 2026 08:48
}

QUrl url = QString::fromStdString(configuration()->checkForAppUpdateUrl());
if (requestParamsProvider()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

let's remove this if, this is an internal service and will always exist in this module

@kryksyh kryksyh Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The idea is that this provider is set by the app, and the framework only provides an interface. That is, only the app knows which params to add.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Similar to IShortcutContextPriority and a few other services

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, it's still worth registering interfaces in those modules rather than relying on someone else to register them somewhere

@kryksyh kryksyh Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hm, I am confused. Please help me understand, what framework side params provider should do.

This is an excerp from pending auadicty PR:

std::vector<std::pair<std::string, std::string> > UsageInfoService::updateRequestParams() const
{
    std::vector<std::pair<std::string, std::string> > params;

    if (!getSendAnonymousUsageInfo()) {
        return params;
    }

    params.emplace_back("audacity-instance-id", instanceId());

    if (authorization()) {
        const std::string userId = authorization()->accountInfo().id;
        if (!userId.empty()) {
            params.emplace_back("user_id", userId);
        }
    }

    return params;
}

GlobalInject<io::IFileSystem> fileSystem;
GlobalInject<ISystemInfo> systemInfo;
GlobalInject<IUpdateConfiguration> configuration;
GlobalInject<IUpdateRequestParamsProvider> requestParamsProvider;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you didn't register this service in the module for use

@kryksyh
kryksyh merged commit 8917fd2 into musescore:main Jun 10, 2026
3 checks passed
@kryksyh
kryksyh deleted the add_irequestparamsprovider branch June 10, 2026 10:35
@Eism Eism mentioned this pull request Jun 22, 2026
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