-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
build: Update version flags #27237
build: Update version flags #27237
Conversation
Revise several changes made in PR ampproject#27196: - 'number' was misspelled several times in TESTING.md and is not a necessary word anyways. Remove 'number' from descriptions of flag. - Flag --version has been supported since 2016 (ampproject#3702). It was inappropriate to simply remove support for the flag, when it can be left in-place without any harm to the build system. - `rtv_version` is not a good choice of name, it reads like "runtime version version" and runtime versions differ from release versions (runtime version includes config number and release version number). Opt for `release_version` which lines up with the version listed on the release page https://github.com/ampproject/amphtml/releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @danielrozenberg, these files were changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdmower Thanks for your attention to detail, and for improving our toolchain. I've added some comments below to further improve things. Let me know what you think.
- 'number' was misspelled several times in TESTING.md and is not a
necessary word anyways. Remove 'number' from descriptions of flag.
Good catch on the misspelling. See comment below on why we use "number".
- Flag --version has been supported since 2016 (use the version flag if provided #3702). It was
inappropriate to simply remove support for the flag, when it can be
left in-place without any harm to the build system.
The italicized part of your statement isn't strictly true. See my comment below about reserved flags in the gulp
CLI.
rtv_version
is not a good choice of name, it reads like "runtime
version version" and runtime versions differ from release versions
(runtime version includes config number and release version number).
Opt forrelease_version
which lines up with the version listed on
the release page ampproject/amphtml/releases.
I agree with your point about "runtime version version" 😃 I don't think we should use release_version
either, since we don't actually use that term in our open-source code or our internal release code. Meanwhile, the getVersion
function in build-system/compile/internal-version.js
uses the term "version number" (it comes from our internal release system, and is used to distinguish from other non-numeric strings).
WDYT about renaming the flag to --version_number
or --version_override
? (Pick the one that seems more intuitive to you.)
The build system isn't harmed by usage of the
I didn't explain, but part of the reason I'm avoiding "version number" is that I'm not sure version must strictly be a number. I've been meaning to do some testing with non numeric versions so that I give accurate instructions in my self-hosted AMP framework guide. If it is possible to use version
I suppose I would lean towards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build system isn't harmed by usage of the
--version=123
flag. I agree the command line can returned unexpected results if used as--version 123
, but that's unrelated to AMP. So, I'm totally on-board with creating a new flag name; I just don't want to remove support for--version=123
.
--version
has always been an undocumented flag that has required a specific invocation style (--flag=value
works, --flag value
doesn't) for at least two years (since #15092, which added gulp-cli
). In addition, the use of invalid flags has been forbidden by the build system for the past month (since #26814).
My main objection in this PR is to the changes in gulpfile.js
(adding taskFunc.undocumented_flags
). I don't think the build system ought to continue supporting undocumented flags, especially if they have since become reserved flags for node
or gulp
.
If there are manual workflows that used to rely on --version
, can you explain why they can't start using --version_override
from here on?
I didn't explain, but part of the reason I'm avoiding "version number" is that I'm not sure version must strictly be a number. I've been meaning to do some testing with non numeric versions so that I give accurate instructions in my self-hosted AMP framework guide. If it is possible to use version
1.2a
, then I don't want to forbid publishers from using their preferred versioning system.
Thanks for the context. This scenario should be supported by gulp build --version_override "1.2a"
, correct?
I suppose I would lean towards
--version_override
in this case.
SGTM.
Of course users can migrate their workflows to the updated flag. The issue I have with PR #26814 and #27196 is the lack of communication and time allotted to deprecating one flag in favor of another. |
Thanks for your thoughts, @mdmower. A few points in response:
Finally, I do accept your higher level point, and agree that we can do better with communicating changes. Will keep this in mind in future. |
Thanks for acknowledging.
In the same |
Good catch. Since it isn’t reserved, and will continue to work once documented, let’s document it. (Are you okay with adding it to this PR?) |
- `--version` flag is not allowed to be reintroduced - `release_version` not accepted, using `version_override` instead - Document `--custom_version_mark` flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* build: Restore --version flag support, update new flag name Revise several changes made in PR ampproject#27196: - 'number' was misspelled several times in TESTING.md and is not a necessary word anyways. Remove 'number' from descriptions of flag. - Flag --version has been supported since 2016 (ampproject#3702). It was inappropriate to simply remove support for the flag, when it can be left in-place without any harm to the build system. - `rtv_version` is not a good choice of name, it reads like "runtime version version" and runtime versions differ from release versions (runtime version includes config number and release version number). Opt for `release_version` which lines up with the version listed on the release page https://github.com/ampproject/amphtml/releases. * Revisions based on review - `--version` flag is not allowed to be reintroduced - `release_version` not accepted, using `version_override` instead - Document `--custom_version_mark` flag
Document flag
custom_version_mark
.Revise some changes made in PR #27196:
TESTING.md
and is not a necessary word anyways. Remove 'number' from descriptions of flag.rtv_version
flag toversion_override
. "rtv version" reads like "runtime version version" and runtime versions differ from release versions (prefixed by config number).