Skip to content
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

Support version upgrade for MSI packages #1786

Closed
wants to merge 14 commits into from

Conversation

Kausik-A
Copy link
Contributor

@Kausik-A Kausik-A commented Jan 27, 2023

Description:

This PR super-seeds #1764. Two major changes are defined in the PR

  1. The new functionality updates the version attribute inside tools/packaging/windows/aws-otel-collector.wxs when bump-version-and-create-release-note.sh is run as part of CD process. This will ensure we build windows packages with the right version

  2. According to wix documentation, it is advised to have a static product ID when building packages so introduced a unique string to update this.

  3. Add MajorUpgrade tag to ensure new version of collector uninstalls the older version of ADOT collector and installs the new one. This mitigates the issue of two collectors being installed and run simultaneously.

Note-1: Currently the sed patterm supports [0-9].[0-9].[0-9]* version pattern. If we ever decide to release with a full semantic version with prefix as vX.XX.XX-prerelease then the .wxs file will need to be manually updated

Note-2: We need not update the CD workflow as mentioned in issue #1765. We update the aws-otel-collector.wxs with value inside VERSIONS. So just checking the VERSION with the version inputted in the CD workflow dispatch would be enough to ensure an incorrect version of windows is not released. This is already been done here

Testing:

Tested locally buy building different versions of ADOT windows packages and installing them on a local machine

Will add screenshots in a while

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Kausik-A Kausik-A requested a review from a team as a code owner January 27, 2023 19:24
@@ -35,6 +35,9 @@ docker run --rm -it -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-chan
# bump the version
echo "${RELEASE_VERSION}" >VERSION

#update aws-otel-collector msi file
sed -i '' "s/\(<Product [^>]*Version=\"\)[^\"]*\"/\1${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you post test results for this oneliner?

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried running it locally but the file was not updated

RELEASE_VERSION=0.26.0 sed -i '' "s/\(<Product [^>]*Version=\"\)[^\"]*\"/\1${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, does RELEASE_VERSION usually include a v prefix? Do we need to remove that before doing the search and replace?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, please add a comment saying that this only supports [0-9]*.[0-9]*.[0-9]* version pattern. If we decide to release with a full sem ver vX.XX.XX-prerelease then the .wxs file will need to be manually updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried running it locally but the file was not updated

I have updated the sed pattern. Here are the results

.wxs file before

Screen Shot 2023-02-01 at 4 51 58 PM

.wxs file after (as expected)

Screen Shot 2023-02-01 at 4 53 16 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, does RELEASE_VERSION usually include a v prefix? Do we need to remove that before doing the search and replace

the RELEASE_VERSION has 'v' prefix it is but this first character is removed by ${RELEASE_VERSION:1}

Also, please add a comment saying that this only supports [0-9].[0-9].[0-9]* version pattern. If we decide to release with a full sem ver vX.XX.XX-prerelease then the .wxs file will need to be manually updated.

Added it in PR description along with comment inside the shell script

Copy link
Contributor

Choose a reason for hiding this comment

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

RELEASE_VERSION=v0.26.0 sed -i '' "s/^Version\=\"[0-9]*.[0-9]*.[0-9]*\"/Version=\"${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs
Results in Version=".26.0" when I run it locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Disregard above. This was a local environment issue. I can confirm it works.

@bryan-aguilar
Copy link
Contributor

Closing in favor of #1808

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