Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(install.sh): add support for--mainline (default) and--stable#12858

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedApr 3, 2024
edited
Loading

This PR adds support for installing either the mainline or stable version of Coder.

The--edge flag was deprecated and--mainline (default) and--stable added in it's place.

The previous implementation for "edge" did not take into account that the release order might not be reliable, so the implementation was updated to perform version-based sorting on all the tags available in the JSON response for releases, and the highest version numer is selected.

In the future we may want to filter out releases on a certain criteria (e.g. exclude draft/prerelease), however, I decided to ommit this to avoid premature feature development and to keep the change simpler.

Note: I decided against embeddingCODER_MAINLINE_VERSION in the script because this introduces added complexity in the release flow:

  1. The release would have to be coupled by a commit updating the variable
  2. There's a race between updating the script with the newCODER_MAINLINE_VERSION and the GitHub Actions build completing, before build completion, the new version is not available, even if cut

Fixes#12461

stirby reacted with heart emoji
@mafredrimafredriforce-pushed themafredri/feat-install.sh-add-stable-mainline-support branch fromf68b2b5 to339acb9CompareApril 3, 2024 14:07
@mafredrimafredri marked this pull request as ready for reviewApril 3, 2024 14:41
@mafredrimafredri requested a review frommtojekApril 3, 2024 14:41
@mafredrimafredriforce-pushed themafredri/feat-install.sh-add-stable-mainline-support branch from2d79f59 toace59dfCompareApril 3, 2024 14:41
# separated numbers and without utilizing the sort -V flag for the
# best compatibility.
curl -fsSL https://api.github.com/repos/coder/coder/releases |
awk -F'"' '/"tag_name"/ {print $4}' |
Copy link
Member

Choose a reason for hiding this comment

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

nit: you didn't want to usejq? :)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I’d love to, but it’s a dependency we can’t afford.

mtojek and bpmct reacted with thumbs up emoji
@@ -106,9 +118,18 @@ echo_standalone_postinstall() {
return
fi

channel=mainline
advisory="To install our stable release (v${STABLE_VERSION}), use the --stable flag. "
Copy link
Member

Choose a reason for hiding this comment

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

nit: the trailing space might not be most convenient form, but I see why you have added this way, one condition less.

mafredri reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I initially had the entire advisory as two separate vars, then I noticed the repetition and extracted common parts 😅, I can go back to that method if you think it’s preferable.

Copy link
Member

@mtojekmtojekApr 3, 2024
edited
Loading

Choose a reason for hiding this comment

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

Probably not worth it, this is just a single condition :) Thanks for sharing more context!

mafredri reacted with thumbs up emoji
install.sh Outdated
@@ -282,8 +303,12 @@ main() {
--version=*)
VERSION="$(parse_arg "$@")"
;;
--edge)
EDGE=1
# Support edge for backwards compatibility.
Copy link
Member

Choose a reason for hiding this comment

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

nit: isn't itbackward (no -s)?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Both forms seem to be used, but perhaps “backward” is the more common one.

mtojek reacted with thumbs up emoji
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/coder/coder/releases/latest)"
version="${version#https://github.com/coder/coder/releases/tag/v}"
echo "${version}"
Copy link
Member

Choose a reason for hiding this comment

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

might be confusing with VERSION

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think the upper/lower case is a good enough distinction, and this practice (case) is often used to separate script global and function local variables. Although inherently case doesn’t differentiate between scope, for that local/typeset/declare needs to be used. Since we’re supporting posix shell though, we don’t try to use such “advance features”. 😄

Copy link
Member

Choose a reason for hiding this comment

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

Alright, we can always adoptlocal keyword :)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

mtojek reacted with eyes emoji
Copy link
Collaborator

@stirbystirby left a comment

Choose a reason for hiding this comment

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

Perfect!!!

mafredri reacted with heart emoji
cath <<EOF

Coder has been installed to
Coder ${channel} release v${VERSION} installed. ${advisory}See our releases documentation or GitHub for more information on versioning.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome 👏

@mafredrimafredri merged commit65f8d18 intomainApr 3, 2024
@mafredrimafredri deleted the mafredri/feat-install.sh-add-stable-mainline-support branchApril 3, 2024 17:26
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 3, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mtojekmtojekmtojek approved these changes

@stirbystirbystirby approved these changes

@bpmctbpmctAwaiting requested review from bpmct

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Stable Releases: Separate mainline and stable ininstall.sh
3 participants
@mafredri@mtojek@stirby

[8]ページ先頭

©2009-2025 Movatter.jp