Skip to content

Fix error message in CodeCheck file #50375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 29, 2023
Merged

Fix error message in CodeCheck file #50375

merged 3 commits into from
Aug 29, 2023

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Aug 28, 2023

This has been causing confusion lately. This PR improves the (previously incomplete) error message in the CodeCheck.ps1 script for PublicApi file changes.

@wtgodbe wtgodbe requested a review from a team as a code owner August 28, 2023 16:25
@ghost ghost added area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Aug 28, 2023
@ghost
Copy link

ghost commented Aug 28, 2023

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@@ -263,7 +263,9 @@ try {

if ($changedAPIBaselines.count -gt 0) {
LogError ("Detected modification to baseline API files. PublicAPI.Shipped.txt files should only " +
"be updated after a major release. See /docs/APIBaselines.md for more information.")
"be updated after a major release, and PublicAPI.Unshipped.txt files should not " +
"be updated in release branches. If this is a preview or rc branch and you've updated a PublicAPI.Unshipped.txt " +
Copy link
Member

Choose a reason for hiding this comment

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

The script exempts preview branches but not rc's.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@@ -253,7 +253,7 @@ try {
}
}
# Check for changes in Unshipped in servicing branches
if ($targetBranch -like 'release*' -and $targetBranch -notlike '*preview*' -and $file -like '*PublicAPI.Unshipped.txt') {
if ($targetBranch -like 'release*' -and $targetBranch -notlike '*preview*' -and $targetBranch -notlike '*rc1*' -and $targetBranch -notlike '*rc2*' -and $file -like '*PublicAPI.Unshipped.txt') {
Copy link
Member Author

Choose a reason for hiding this comment

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

Did this instead of *rc* to decrease the odds of an accidental hit

@wtgodbe wtgodbe merged commit e4b318b into release/8.0 Aug 29, 2023
@wtgodbe wtgodbe deleted the wtgodbe/CodeCheck branch August 29, 2023 15:41
@ghost ghost added this to the 8.0-rc2 milestone Aug 29, 2023
@wtgodbe wtgodbe added the tell-mode Indicates a PR which is being merged during tell-mode label Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework tell-mode Indicates a PR which is being merged during tell-mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants