Skip to content
Snippets Groups Projects

#3492411 CI variables and templates version

Closes #3492411

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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 Smith
  • if 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.

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 520b3f14 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • added 1 commit

    • f99bd811 - Edits in the webIDE are misleading when it comes to spaces.

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Jonathan Smith added 18 commits

    added 18 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading