enhancement: introduce release channel capability #2001
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
set the edition capability to a build time flag which represents the release channel! Available channels are:
dev: local builds and builds without ldflags$(OC_REPO)/pkg/version.Edition=$(EDITION)rollingstablelts-0.0.0, the contained version number must follow semver!unfortunately oc had the public config sets for setting the edition as part of the config or as env variable such as:
config:editionenv:OC_EDITIONenv:FRONTEND_EDITIONenv:OCDAV_EDITIONthe ability to configure that value has been removed as part of the pr, deprecating the env is not easy and it should not be in use anyway, but who knows..., @micbar lets discuss, i still can change the behavior!
Related Issue
Motivation and Context
Having detailed information of which build channel the current server binary is originated from, web also requested such a capability to display it.
Todos:
Env:EDITIONto the each related block of our woodpecker.ymlArg:EDITIONto all related docker imagesQuestions:
Q: Should our make step automatically parse the current branch to determine the current
Env:CHANNEL, should work out of the box forstable, but what about rolling and nightly?edition:rollingedition:stableedition:rollingQ: if the channel is unknown running the binary fails (i added a validation for that), current allowed values are:
rolling, rolling, stable, and lts-0.0.0, in other words, it panics with a message, ok or maybe we should just log a warning!? ..., @kulmann, @micbardevQ: any woodpecker magic needed? Tags, manuall triggered ci runs, ..., @flimmy
Q: removing
env:OC_EDITION,...without deprecating it is ok!?How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: