Skip to content

fix: resolve three CI build/quality errors - #361

Merged
winnerspiros merged 5 commits into
masterfrom
copilot/merge-ppy-commit-fix-build-errors
May 28, 2026
Merged

fix: resolve three CI build/quality errors#361
winnerspiros merged 5 commits into
masterfrom
copilot/merge-ppy-commit-fix-build-errors

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown

CI was failing across all jobs due to a compile error in ScoreProcessor, plus two code quality violations caught by the Code Quality job.

Changes

  • ScoreProcessor.csMods.ValueChanged handler called new ScoreMultiplierContext() with no arguments, but the constructor requires IBeatmapDifficultyInfo beatmapDifficultyWithoutMods. Replaced the inline calculator construction with a call to the already-existing updateScoreMultiplier(), which null-guards Beatmap.Value and passes the correct difficulty:

    // before (CS7036 — missing required parameter)
    var calculator = ruleset.CreateScoreMultiplierCalculator(new ScoreMultiplierContext());
    scoreMultiplier = calculator.CalculateFor(mods.NewValue);
    
    // after
    updateScoreMultiplier();
  • BackgroundDataStoreProcessor.csLoadComplete had { on the same line as ), violating IDE0055 (fix formatting).

  • DatabasedKeyBindingContainer.csusing System.Diagnostics.CodeAnalysis; was unused (IDE0005). Removed.

tsunyoku and others added 4 commits May 28, 2026 12:44
…lculations (ppy#37921)

- Part of ppy#37818

Access to difficulty info is required for the upcoming multiplier
proposals. All places providing difficulty info intentionally use
`IBeatmapInfo` as the difficulty info exposed to the calculator should
_always_ be pre-mods for our usecase.

There's a couple of quirks:

- The usage in `ScoreProcessor` is a bit troubling to me but I can't see
a way to make it better without refactoring it. Essentially, we don't
have a beatmap until `ApplyBeatmap` is called, but most usages of
`ScoreProcessor` are setting `Mods` prior to `ApplyBeatmap` so there is
a `null` check in the logic for when mods change. Additionally, this
means a new bindable of the beatmap via `ApplyBeatmap` which also feels
a bit dirty. Open to suggestions.
- ~~`BeatmapLeaderboardScore.Tooltip` is using a null-forgiving on the
`BeatmapInfo`, but there's basically no context available on if this is
an issue - the only code path which sets the score is `SetContent` which
has no callers, so it's essentially dead code. Makes sense given it's
Select V1.~~

---------

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
- Merge ppy/osu commit 45234b5 (add beatmap difficulty before mods as
  context for score multiplier calculations)
- Fix iOS build error: remove ServerGarbageCollection/ConcurrentGarbageCollection
  from iOS dotnet publish step (not supported by .NET for iOS)
- Add [DynamicallyAccessedMembers] annotations to SettingSourceAttribute:
  declaringType param, SettingControlType property
- Add [RequiresUnreferencedCode] to SettingSourceAttribute extension methods:
  CreateSettingsControls, GetSettingsSourceProperties,
  GetOrderedSettingsSourceProperties, GetUnderlyingSettingValue
- Add [RequiresUnreferencedCode] to BindableValueAccessor.GetValue/SetValue
- Add [RequiresUnreferencedCode] to SnakeCaseKeyContractResolver class
- Fix Assembly.Location → AppContext.BaseDirectory in Icons.cs,
  MacOSAppLocationChecker.cs, WindowsAssociationManager.cs
- Add [RequiresUnreferencedCode] to LegacyTcpIpcProvider class
- Add [RequiresUnreferencedCode] to DiscordRichPresence class
- Add [RequiresAssemblyFiles] to WindowsKey.Disable()
- Add #pragma warning disable IL2026 around AsQueryable() in
  DatabasedKeyBindingContainer.LoadComplete()
- Add [RequiresUnreferencedCode] to BackgroundDataStoreProcessor
  processScoresWithMissingStatistics() and LoadComplete()
…p setter

The fork uses C# 13 `field` keyword so there's no explicit `score` backing
field in scope. The upstream-merged line incorrectly referenced `score`;
`value` (the setter parameter) is the correct variable here.
@gitar-bot

gitar-bot Bot commented May 28, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

Copilot AI changed the title Merge ppy upstream + fix iOS build failure + suppress trimming/AOT warnings fix: resolve three CI build/quality errors May 28, 2026
Copilot AI requested a review from winnerspiros May 28, 2026 16:08
@winnerspiros
winnerspiros marked this pull request as ready for review May 28, 2026 16:32
Copilot AI review requested due to automatic review settings May 28, 2026 16:32
@winnerspiros
winnerspiros merged commit 7aec46e into master May 28, 2026
18 of 22 checks passed

Copilot AI 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.

Pull request overview

This PR addresses scoring multiplier construction and trim/single-file publish related warnings, but it is broader than the stated three CI fixes. It updates score multiplier context creation across runtime, tests, and benchmarks, adds trim annotations/suppressions, adjusts desktop app path lookup, and changes the iOS release publish flags.

Changes:

  • Redesigns ScoreMultiplierContext to require beatmap difficulty and updates affected score multiplier call sites.
  • Adds trim/AOT annotations or suppressions around reflection/Newtonsoft usage.
  • Replaces some assembly-location path lookups with AppContext.BaseDirectory and removes iOS GC publish properties.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
osu.Game/Rulesets/Scoring/ScoreMultiplierCalculator.cs Makes beatmap difficulty required in score multiplier context.
osu.Game/Rulesets/Scoring/ScoreProcessor.cs Tracks current beatmap and recalculates multiplier from beatmap difficulty.
osu.Game/Screens/Select/FooterButtonMods.cs Uses current beatmap difficulty when displaying mod multiplier.
osu.Game/Screens/Select/BeatmapLeaderboardScore.Tooltip.cs Uses score beatmap difficulty for tooltip multiplier.
osu.Game/Overlays/Mods/ModSelectFooterContent.cs Uses working beatmap difficulty for mod footer multiplier.
osu.Game/Scoring/Legacy/LegacyScoreDecoder.cs Supplies score beatmap difficulty during legacy score multiplier calculation.
osu.Game/Database/StandardisedScoreMigrationTools.cs Supplies beatmap difficulty during score migration multiplier calculation.
osu.Game/Database/BackgroundDataStoreProcessor.cs Adds trim-related annotations around score statistic processing.
osu.Game/Configuration/SettingSourceAttribute.cs Adds trim annotations for reflection-based settings helpers.
osu.Game/Utils/BindableValueAccessor.cs Marks reflection-based bindable accessors as trim-unsafe.
osu.Game/IO/Serialization/SnakeCaseKeyContractResolver.cs Marks Newtonsoft contract resolver as trim-unsafe.
osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs Suppresses IL2026 around realm query mapping reload.
osu.Desktop/DiscordRichPresence.cs Marks rich presence component as trim-unsafe due to Newtonsoft usage.
osu.Desktop/LegacyIpc/LegacyTcpIpcProvider.cs Marks legacy IPC provider as trim-unsafe due to Newtonsoft usage.
osu.Desktop/Windows/WindowsKey.cs Marks Windows key hook disable path as requiring assembly files.
osu.Desktop/Windows/WindowsAssociationManager.cs Builds executable path from app base directory and friendly name.
osu.Desktop/Windows/Icons.cs Uses app base directory for icon lookup.
osu.Desktop/MacOS/MacOSAppLocationChecker.cs Uses app base directory for macOS install-location checks.
.github/workflows/release.yml Removes server/concurrent GC properties from iOS publish.
Test and benchmark files Update score multiplier tests/benchmarks to pass beatmap difficulty context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to 82
[RequiresUnreferencedCode("Calls processScoresWithMissingStatistics which uses Newtonsoft.Json reflection.")]
protected override void LoadComplete()
/// In usages where the current valid score multipliers are required, pass <see langword="null"/> or omit this parameter entirely.
/// </param>
public ScoreMultiplierContext(ScoreInfo? score)
public ScoreMultiplierContext(IBeatmapDifficultyInfo beatmapDifficultyWithoutMods, ScoreInfo? score = null)
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