Skip to content

Add script for reviewing project template changes

What does this MR do and why?

Describe in detail what your merge request does and why.

Project templates are a vendored as a tarball. It's difficult to review these as there are a lot of file operations needed in order to extract the templates and compare them. This adds an automated script to enable people to more easily review template changes.

See:

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Demo output:

Click to expand
./template-changes vendor/project_templates/middleman.tar.gz
Extracting template to: /var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3
Updating files: 100% (4612/4612), done.
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Updating files: 100% (4612/4612), done.
Switched to branch 'review/370981-middleman-template'

🧐 Comparing new template with master

diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/GITLAB_REVISION b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/GITLAB_REVISION
index f8fd69b9aac3..aff1a06828a0 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/GITLAB_REVISION
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/GITLAB_REVISION
@@ -1 +1 @@
-994463c67df
\ No newline at end of file
+b837a1ea452
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/GITLAB_VERSION b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/GITLAB_VERSION
index efb8b44828a2..a93d68911fda 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/GITLAB_VERSION
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/GITLAB_VERSION
@@ -1 +1 @@
-14.9.0-pre
\ No newline at end of file
+15.7.0-pre
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/project.bundle b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/project.bundle
index f433c61bb12d..01bd4f5f64e1 100644
Binary files a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/project.bundle and b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/project.bundle differ
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/auto_devops.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/auto_devops.ndjson
index ec747fa47ddb..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/auto_devops.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/auto_devops.ndjson
@@ -1 +0,0 @@
-null
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/ci_cd_settings.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/ci_cd_settings.ndjson
index 09e1f9d49363..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/ci_cd_settings.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/ci_cd_settings.ndjson
@@ -1 +0,0 @@
-{"group_runners_enabled":true,"runner_token_expiration_interval":null}
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/container_expiration_policy.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/container_expiration_policy.ndjson
index c8b5994a0421..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/container_expiration_policy.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/container_expiration_policy.ndjson
@@ -1 +0,0 @@
-{"project_id":49,"created_at":"2022-03-11T18:36:20.438Z","updated_at":"2022-03-11T18:36:20.438Z","next_run_at":"2022-03-12T18:36:20.436Z","name_regex":".*","cadence":"1d","older_than":"90d","keep_n":10,"enabled":false,"name_regex_keep":null}
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/error_tracking_setting.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/error_tracking_setting.ndjson
index ec747fa47ddb..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/error_tracking_setting.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/error_tracking_setting.ndjson
@@ -1 +0,0 @@
-null
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/metrics_setting.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/metrics_setting.ndjson
index f7f77c27cd87..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/metrics_setting.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/metrics_setting.ndjson
@@ -1 +0,0 @@
-{"project_id":49,"external_dashboard_url":null,"dashboard_timezone":"local"}
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/project_feature.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/project_feature.ndjson
index 4d1e8a9f3fdb..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/project_feature.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/project_feature.ndjson
@@ -1 +0,0 @@
-{"project_id":49,"merge_requests_access_level":20,"issues_access_level":20,"wiki_access_level":20,"snippets_access_level":20,"builds_access_level":20,"created_at":"2022-03-11T18:36:20.459Z","updated_at":"2022-03-11T18:36:20.459Z","repository_access_level":20,"pages_access_level":10,"forking_access_level":20,"metrics_dashboard_access_level":10,"requirements_access_level":20,"operations_access_level":20,"analytics_access_level":20,"security_and_compliance_access_level":10,"container_registry_access_level":20}
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/project_members.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/project_members.ndjson
index ad1e320fb788..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/project_members.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/project_members.ndjson
@@ -1 +0,0 @@
-{"access_level":40,"source_type":"Project","user_id":47,"notification_level":3,"created_at":"2022-03-11T18:36:21.009Z","updated_at":"2022-03-11T18:36:21.009Z","created_by_id":47,"invite_email":null,"invite_accepted_at":null,"requested_at":null,"expires_at":null,"ldap":false,"override":false,"user":{"id":47,"username":"user3","public_email":""}}
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/push_rule.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/push_rule.ndjson
index ec747fa47ddb..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/push_rule.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/push_rule.ndjson
@@ -1 +0,0 @@
-null
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/security_setting.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/security_setting.ndjson
index 9f22502b100a..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/security_setting.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/security_setting.ndjson
@@ -1 +0,0 @@
-{"project_id":49,"created_at":"2022-03-11T18:36:20.472Z","updated_at":"2022-03-11T18:36:20.472Z","auto_fix_container_scanning":true,"auto_fix_dast":true,"auto_fix_dependency_scanning":true,"auto_fix_sast":true}
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/service_desk_setting.ndjson b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/service_desk_setting.ndjson
index ec747fa47ddb..e69de29bb2d1 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project/service_desk_setting.ndjson
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project/service_desk_setting.ndjson
@@ -1 +0,0 @@
-null
\ No newline at end of file
diff --git a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project.json b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project.json
index 534f12a47980..9e26dfeeb6e6 100644
--- a/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1hhmo40/tree/project.json
+++ b/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-vumwo3/tree/project.json
@@ -1 +1 @@
-{"description":null,"visibility_level":0,"archived":false,"merge_requests_template":null,"merge_requests_rebase_enabled":false,"approvals_before_merge":0,"reset_approvals_on_push":true,"merge_requests_ff_only_enabled":false,"issues_template":null,"shared_runners_enabled":true,"build_coverage_regex":null,"build_allow_git_fetch":true,"build_timeout":3600,"pending_delete":false,"public_builds":true,"last_repository_check_failed":null,"only_allow_merge_if_pipeline_succeeds":false,"has_external_issue_tracker":null,"request_access_enabled":true,"has_external_wiki":null,"ci_config_path":null,"only_allow_merge_if_all_discussions_are_resolved":false,"printing_merge_request_link_enabled":true,"auto_cancel_pending_pipelines":"enabled","service_desk_enabled":false,"delete_error":null,"disable_overriding_approvers_per_merge_request":false,"resolve_outdated_diff_discussions":false,"jobs_cache_index":null,"external_authorization_classification_label":null,"pages_https_only":false,"merge_requests_author_approval":false,"merge_requests_disable_committers_approval":false,"require_password_to_approve":false,"remove_source_branch_after_merge":true,"autoclose_referenced_issues":true,"suggestion_commit_message":null}
\ No newline at end of file
+{}
\ No newline at end of file

--- end diff ---
Cloning into 'middleman'...
Receiving objects: 100% (24/24), 8.21 KiB | 8.21 MiB/s, done.

📝 Template is created from https://gitlab.com/gitlab-org/project-templates/middleman at commit 353060e796b92e2c3f70ddc81c0e02d878b9319c


🧐 Verifying that template repo matches remote

Cloning into '/var/folders/w2/czj7k5493wv6dx_fncqbl1fh0000gn/T/middleman20221212-55850-1otzo4k'...
warning: redirecting to https://gitlab.com/gitlab-org/project-templates/middleman.git/
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 30 (delta 0), reused 1 (delta 0), pack-reused 26
Receiving objects: 100% (30/30), 10.94 KiB | 10.94 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Note: switching to '353060e796b92e2c3f70ddc81c0e02d878b9319c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 353060e Merge branch 'issue_370981_add_env_key_to_middleman_temp' into 'main'
commit 353060e796b92e2c3f70ddc81c0e02d878b9319c (HEAD, origin/main, origin/HEAD, main)
Merge: 468650c 15a1f74
Author: Sean Carroll <scarroll@gitlab.com>
Date:   Mon Sep 19 12:01:09 2022 +0000

    Merge branch 'issue_370981_add_env_key_to_middleman_temp' into 'main'
    
    Add environment keyword to pages job
    
    See merge request gitlab-org/project-templates/middleman!1

HEAD detached at 353060e
nothing to commit, working tree clean

✅ Template is up to date with the given remote commit

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Check out this merge request locally: !105776 (merged)
  2. Run: ./template-changes vendor/project_templates/middleman.tar.gz

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Brian Williams

Merge request reports

Loading