Skip to content

Commit

Permalink
Try to prevent identical version numbers across branches by matching …
Browse files Browse the repository at this point in the history
…hardcoded prerelease identifiers with hardcoded branch name. (#11893)

If we hardcode a prelease identifier for a .NET release, we can easily end up
with multiple branches using the same version number, because the hardcoded
prerelease identifier ends up being the same for any other branches that are
created later from the release branch (one typical example would be backport
branches).

This is bad.

So try to prevent this, by hardcoding two values instead!

We'll hardcode the branch name where the hardcoded prerelease identifier
should be applied, and this way any other branches will not use the hardcoded
prerelease identifier.

Ref: #11891.
  • Loading branch information
rolfbjarne authored Jun 11, 2021
1 parent 8bec55e commit dd5f9f7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,22 @@ else ifneq ($(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER),)
PULL_REQUEST_ID=$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)
endif

# For release branches, modify the following variables to hardcode a version name
# Set the NUGET_HARDCODED_PRERELEASE_IDENTIFIER variable to the prerelease identifer you want (say "preview.5")
NUGET_HARDCODED_PRERELEASE_IDENTIFIER=
# Set the NUGET_HARDCODED_PRERELEASE_BRANCH variable to the exact name for the branch the above variable should apply to (so that any other branches won't pick it up by accident).
# For the previous example, this would be "release/6.0.1xx-preview5"
NUGET_HARDCODED_PRERELEASE_BRANCH=

# compute the alphanumeric version of the hardcoded prerelease branch
NUGET_HARDCODED_PRERELEASE_BRANCH_ALPHANUMERIC:=$(shell export LANG=C; printf "%s" "$(NUGET_HARDCODED_PRERELEASE_BRANCH)" | tr -c '[a-zA-Z0-9-]' '-')

# The prerelease identifier is missing the per-product commit distance, which is added below
# DO NOT MODIFY THE BELOW CONDITIONS TO HARDCODE A VERSION NUMBER FOR RELEASE BRANCHES.
ifneq ($(PULL_REQUEST_ID),)
NUGET_PRERELEASE_IDENTIFIER=ci.pr.gh$(PULL_REQUEST_ID).
else ifeq ($(NUGET_HARDCODED_PRERELEASE_BRANCH_ALPHANUMERIC),$(CURRENT_BRANCH_ALPHANUMERIC))
NUGET_PRERELEASE_IDENTIFIER=$(NUGET_HARDCODED_PRERELEASE_IDENTIFIER)
else
NUGET_PRERELEASE_IDENTIFIER=ci.$(CURRENT_BRANCH_ALPHANUMERIC).
endif
Expand Down

7 comments on commit dd5f9f7

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

Packages generated

View packages

Test results

1 tests failed, 220 tests passed.

Failed tests

  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed

Pipeline on Agent XAMBOT-1036.BigSur'
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ Tests failed on macOS Mac Catalina (10.15) ❌

Tests failed on Mac Catalina (10.15).

Failed tests are:

  • introspection

Pipeline on Agent
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac High Sierra (10.13) ✅

Tests passed

All tests on macOS X Mac High Sierra (10.13) passed.

Pipeline on Agent
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS32b). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
Try to prevent identical version numbers across branches by matching hardcoded prerelease identifiers with hardcoded branch name. (#11893)

Please sign in to comment.