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

Fixing release workflow #256

Merged
merged 3 commits into from
Jun 27, 2022
Merged

Fixing release workflow #256

merged 3 commits into from
Jun 27, 2022

Conversation

olemartinorg
Copy link
Contributor

Description

This should fix the failing release publishing now that the command got split into multiple distinct steps

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Ole Martin Handeland added 2 commits June 27, 2022 15:11
…ithub workflow. This should fix the failing release publishing now that the command got split into multiple distinct steps
@olemartinorg olemartinorg requested a review from tjololo June 27, 2022 13:13
Copy link
Member

@tjololo tjololo left a comment

Choose a reason for hiding this comment

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

Added a suggestion but script should work as is

COMMIT_ID=$(git rev-parse HEAD~0)
echo ::set-output name=APP_MAJOR::${CURRENT_VERSION_PARTS[0]:1}
echo ::set-output name=APP_MINOR::${CURRENT_VERSION_PARTS[1]}
echo ::set-output name=APP_PATCH::${CURRENT_VERSION_PARTS[2]}
Copy link
Member

@tjololo tjololo Jun 27, 2022

Choose a reason for hiding this comment

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

Consider if this step should have an output ala APP_FULL_VERSION since we have many uses where we combine alle of these. This would in my opinion make the rest of the workflow more readable.

echo ::set-output name=APP_FULL_VERSION::${APP_MAJOR}.${APP_MINOR}.${APP_PATCH}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Smart! I replaced those, as well as those using MAJOR.MINOR, so now there's no more double or triple variable reads on one line.

mkdir -p ./cdn/toolkits/altinn-app-frontend/$APP_MAJOR.$APP_MINOR.$APP_PATCH
cp -fr ./app-frontend/src/altinn-app-frontend/dist/altinn-app-frontend.js ./cdn/toolkits/altinn-app-frontend/$APP_MAJOR.$APP_MINOR.$APP_PATCH/altinn-app-frontend.js
cp -fr ./app-frontend/src/altinn-app-frontend/dist/altinn-app-frontend.css ./cdn/toolkits/altinn-app-frontend/$APP_MAJOR.$APP_MINOR.$APP_PATCH/altinn-app-frontend.css
mkdir -p ./cdn/toolkits/altinn-app-frontend/${{ steps.prepare.outputs.APP_MAJOR }}.${{ steps.prepare.outputs.APP_MINOR }}.${{ steps.prepare.outputs.APP_PATCH }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this path correct? It looks the same as the one in the previous step (line 70). Should it be in a prerelease directory or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it possibly should. The thinking in #179 was to add preliminary support for prereleases, or, at least not overwrite the major version if someone checks that box. We could (and should) think this through some more before we go ahead with releasing preview versions en-masse. Right now we're releasing from main, so if we were to release (for example) `v3.45.0-preview1` from a certain feature-branch, there's no guarantee the proper v3.45.0 won't be released without the features in that feature-branch.

And per your suggestion, if we introduce a prerelease folder, that would also complicate the list of versions generated in #179 - and thus it would complicate #8562.

I'm open to any suggestions, but right now it's most important that checking the "this is a prerelease" checkbox doesn't just run the regular release workflow (which overwrites the major version).

Copy link
Contributor

@haakemon haakemon Jul 4, 2022

Choose a reason for hiding this comment

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

I missed the reply on this (github notifications and I arent best friends 😅)

But it seems like we are overwriting the current patch version on prerelease releases with the current workflow? Or am I misunderstanding?

I am misunderstanding 🙂 We will anyway increase the patch version number on prerelease, so in effect we will get new patch versions, but minor and major will not be modified.

I think the current approach is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned in the huddle; no, as long as each new release has its own unique patch version, this overwrites nothing.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@olemartinorg olemartinorg merged commit 163b601 into main Jun 27, 2022
@olemartinorg olemartinorg deleted the chore/fixing-release-workflow branch June 27, 2022 13:44
@olemartinorg olemartinorg mentioned this pull request Sep 14, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants