Repository navigation
fix(build): build SW.Bitween.Web once per solution build - #371
Merged
Merged
Conversation
SW.Bitween.HttpTests referenced the web project with
<Properties>SkipClientBuild=true</Properties>. MSBuild builds a project once
per set of global properties, so a solution build without that property (the
shared dotnet-build action) built SW.Bitween.Web twice, in parallel, into the
same obj folder. The two runs of DefineStaticWebAssets then collided on
rpswa.dswa.cache.json ("being used by another process"), failing the build
now and then since the HTTP tests landed: runs #118, #136, #140 and #149.
The property skipped nothing: BuildClientApp runs after
ComputeFilesToPublish, which a project reference never runs. The PR checks
pass -p:SkipClientBuild=true to every project, so there the two builds were
one and the race never showed.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (8)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The develop pipeline's test build fails now and then with:
This happened in runs #118, #136, #140 and #149. Every one of them included 5b68bb7 (the HTTP tests), and none of the runs before it failed this way.
Cause
SW.Bitween.HttpTestsreferenced the web project with<Properties>SkipClientBuild=true</Properties>. MSBuild builds a project once for each set of global properties. The shareddotnet-buildaction builds the solution without that property, soSW.Bitween.Webwas built twice, in parallel, into the sameobjfolder. When the two builds overlap, they collide on the static web assets cache.The PR checks pass
-p:SkipClientBuild=trueto every project, so there the two builds are the same build, and the race never showed.The property didn't skip anything.
BuildClientAppruns afterComputeFilesToPublish, and a project reference never runs that target. The<SkipClientBuild>in HttpTests' own PropertyGroup doesn't reach the web project at all.Change
Remove both properties, and add a comment on the reference saying why it carries none.
Evidence
I ran a throwaway workflow (now deleted) that runs the action's own
dotnet restore+dotnet build SW.Bitween.sln --configuration Release:SW.Bitween.Web ->linesThe develop run #148 log also shows two
SW.Bitween.Web -> .../bin/Release/net10.0/SW.Bitween.Web.dlllines, 23 s apart; the PR checks log shows one.The 4 HttpTests failures happen with and without this change, for example
BackgroundTests.The_system_jobs_are_scheduled_and_say_when_they_run_next. CI doesn't run HttpTests.