#3492411 CI variables and templates version
Closes #3492411
Merge request reports
Activity
added 1 commit
- 8d0d2aad - Do not print CI_COMMIT_AUTHOR in .show-environment-variables
added 1 commit
- f1fdc650 - Add GITLAB_TEMPLATES_VERSION variable and include a check for it
added 1 commit
- f81cb8ae - Add version to run-local-checks.sh (with known faults)
added 1 commit
- 39bfb7ef - Replicate shellcheck fixes into Check Code job
- Resolved by Jonathan Smith
Both of those are nice ideas, but they both seem too complex for this one piece of data. I've written the internal check to make sure that the variable value in hidden-variables.yml matches the latest version in the changelog.md. So when you (or anyone) adds a new version to the change log if you forget to update the hidden-variables value then the next pipeline run will tell you, or run-local-checks will also tell you.
But I understand that you may not want the extra work of updating the variable, so the next simplest solution is to not have the variable in the file at all, but add the following into
create-environment-variables
curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/CHANGELOG.md export GITLAB_TEMPLATES_VERSION=$(grep '##' < CHANGELOG.md | head -1 | cut -d' ' -f2 ) echo -e "GITLAB_TEMPLATES_VERSION=$GITLAB_TEMPLATES_VERSION" >> build.env
Reading the tags using the API sounds fun and interesting, but I'm not sure I would know where to start to achieve that.
Edited by Jonathan Smithif somebody uses
main
then the information won’t be accurate.Yes that's right. Just wondering what your procedure is, because I am sure sometimes I've seen the changelog with new issues and commits added at the top, but without a date. These are the changes that are comitted to
main
but not in a release yet. Currently there is one such issue (in addition to doc updates) but it is not in the changelog yet. see this list. If the issues were added when committed and we used the curl method, then it could show what is in main accurately if that was the ref being used.Edited by Jonathan Smith- Resolved by Jonathan Smith
Reading the tags using the API sounds fun and interesting, but I'm not sure I would know where to start to achieve that.
How about I give you something to start with? I'm going to make a commit with a PHP script that you can use like:
-
php scripts/extract-version.php default-ref 96292
==>GitLab Templates version: 1.6.9, default-ref
-
php scripts/extract-version.php main 96292
==>GitLab Templates version: main
-
php scripts/extract-version.php 1.5.x-latest 96292
==>GitLab Templates version: 1.5.10, 1.5.x-latest
We'd need to curl it first, and then use
php scripts/extract_version.php $_GITLAB_TEMPLATES_REF $GITLAB_TEMPLATES_PROJECT_ID
(second param optional)Edited by Fran Garcia-Linares -
added 1 commit
- 8d66b643 - Add script to extract current version being used.
- Resolved by Fran Garcia-Linares
- Resolved by Fran Garcia-Linares
added 1 commit
- f99bd811 - Edits in the webIDE are misleading when it comes to spaces.
added 18 commits
-
7f2d59bc...3517a372 - 3 commits from branch
project:main
- 3517a372...cbd0a652 - 5 earlier commits
- 2e10cde2 - Fix version value (and a typo)
- a18eb9b5 - Add version to run-local-checks.sh (with known faults)
- 74cbd7a7 - and the shellcheck fixess
- f2a6418a - Replicate shellcheck fixes into Check Code job
- b3e28111 - Add script to extract current version being used.
- f0c4fbe9 - PHP docs.
- bad3f584 - Apply 1 suggestion(s) to 1 file(s)
- c513e492 - Edits in the webIDE are misleading when it comes to spaces.
- 3c83ddbf - Add word to cspell.
- e659bd21 - Change name.
Toggle commit list-
7f2d59bc...3517a372 - 3 commits from branch