From 7ef8ef9190f52a35d93300191fe75b47f1b29966 Mon Sep 17 00:00:00 2001 From: Kira Muhlbauer Date: Fri, 8 Nov 2024 13:03:49 -0700 Subject: [PATCH 1/2] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b57b73873..b318a9f3a 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ The tool is deployed through a number of channels. The primary release channel i ### Homebrew -We publish the tool to [Homebrew](https://brew.sh/). The tool is [part of `homebrew-core`](https://github.com/Homebrew/homebrew-core/blob/main/Formula/circleci.rb), and therefore the maintainers of the tool are obligated to follow the guidelines for acceptable Homebrew formulae. You should [familairise yourself with the guidelines](https://docs.brew.sh/Acceptable-Formulae#we-dont-like-tools-that-upgrade-themselves) before making changes to the Homebrew deployment system. +We publish the tool to [Homebrew](https://brew.sh/). The tool is [part of `homebrew-core`](https://github.com/Homebrew/homebrew-core/blob/main/Formula/circleci.rb), and therefore the maintainers of the tool are obligated to follow the guidelines for acceptable Homebrew formulae. You should [familiarize yourself with the guidelines](https://docs.brew.sh/Acceptable-Formulae#we-dont-like-tools-that-upgrade-themselves) before making changes to the Homebrew deployment system. The particular considerations that we make are: From b12b57719d12d8823b15c79843fec4808f165102 Mon Sep 17 00:00:00 2001 From: Kira Muhlbauer Date: Fri, 8 Nov 2024 14:01:52 -0700 Subject: [PATCH 2/2] support additional pipeline parameters in config validation --- config/pipeline.go | 39 +++++++++++++++++++++++++++------- config/pipeline_test.go | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/config/pipeline.go b/config/pipeline.go index e6b09b659..66c86e3bf 100644 --- a/config/pipeline.go +++ b/config/pipeline.go @@ -32,14 +32,37 @@ func LocalPipelineValues(parameters Parameters) Values { } vals := map[string]interface{}{ - "pipeline.id": "00000000-0000-0000-0000-000000000001", - "pipeline.number": 1, - "pipeline.project.git_url": gitUrl, - "pipeline.project.type": projectType, - "pipeline.git.tag": git.Tag(), - "pipeline.git.branch": git.Branch(), - "pipeline.git.revision": revision, - "pipeline.git.base_revision": revision, + "pipeline.id": "00000000-0000-0000-0000-000000000001", + "pipeline.number": 1, + "pipeline.project.git_url": gitUrl, + "pipeline.project.type": projectType, + "pipeline.git.tag": git.Tag(), + "pipeline.git.branch": git.Branch(), + "pipeline.git.revision": revision, + "pipeline.git.base_revision": revision, + "pipeline.git.branch.is_default": false, + "pipeline.trigger_parameters.circleci.event_time": "2020-01-01T00:00:00Z", + "pipeline.trigger_parameters.webhook.body": "", + "pipeline.trigger_parameters.github_app.branch": "main", + "pipeline.trigger_parameters.github_app.checkout_sha": revision, + "pipeline.trigger_parameters.github_app.commit_sha": revision, + "pipeline.trigger_parameters.github_app.commit_title": "", + "pipeline.trigger_parameters.github_app.commit_message": "", + "pipeline.trigger_parameters.github_app.commit_timestamp": "2020-01-01T00:00:00Z", + "pipeline.trigger_parameters.github_app.commit_author_name": "", + "pipeline.trigger_parameters.github_app.ref": "refs/heads/master", + "pipeline.trigger_parameters.github_app.repo_name": "", + "pipeline.trigger_parameters.github_app.repo_url": "", + "pipeline.trigger_parameters.github_app.total_commits_count": 1, + "pipeline.trigger_parameters.github_app.user_avatar": "", + "pipeline.trigger_parameters.github_app.user_id": "00000000-0000-0000-0000-000000000001", + "pipeline.trigger_parameters.github_app.user_name": "", + "pipeline.trigger_parameters.github_app.user_username": "", + "pipeline.trigger_parameters.github_app.web_url": "", + "pipeline.trigger_parameters.gitlab.commit_sha": revision, + "pipeline.trigger_parameters.gitlab.default_branch": "main", + "pipeline.trigger_parameters.gitlab.x_gitlab_event_id": "00000000-0000-0000-0000-000000000001", + "pipeline.trigger_parameters.gitlab.is_fork_merge_request": false, } for k, v := range parameters { diff --git a/config/pipeline_test.go b/config/pipeline_test.go index 6e2cd815e..213897acc 100644 --- a/config/pipeline_test.go +++ b/config/pipeline_test.go @@ -25,6 +25,29 @@ func TestLocalPipelineValues(t *testing.T) { "pipeline.git.branch", "pipeline.git.revision", "pipeline.git.base_revision", + "pipeline.git.branch.is_default", + "pipeline.trigger_parameters.circleci.event_time", + "pipeline.trigger_parameters.webhook.body", + "pipeline.trigger_parameters.github_app.branch", + "pipeline.trigger_parameters.github_app.checkout_sha", + "pipeline.trigger_parameters.github_app.commit_sha", + "pipeline.trigger_parameters.github_app.commit_title", + "pipeline.trigger_parameters.github_app.commit_message", + "pipeline.trigger_parameters.github_app.commit_timestamp", + "pipeline.trigger_parameters.github_app.commit_author_name", + "pipeline.trigger_parameters.github_app.ref", + "pipeline.trigger_parameters.github_app.repo_name", + "pipeline.trigger_parameters.github_app.repo_url", + "pipeline.trigger_parameters.github_app.total_commits_count", + "pipeline.trigger_parameters.github_app.user_avatar", + "pipeline.trigger_parameters.github_app.user_id", + "pipeline.trigger_parameters.github_app.user_name", + "pipeline.trigger_parameters.github_app.user_username", + "pipeline.trigger_parameters.github_app.web_url", + "pipeline.trigger_parameters.gitlab.commit_sha", + "pipeline.trigger_parameters.gitlab.default_branch", + "pipeline.trigger_parameters.gitlab.x_gitlab_event_id", + "pipeline.trigger_parameters.gitlab.is_fork_merge_request", }, }, { @@ -41,6 +64,29 @@ func TestLocalPipelineValues(t *testing.T) { "pipeline.git.base_revision", "pipeline.parameters.foo", "pipeline.parameters.baz", + "pipeline.git.branch.is_default", + "pipeline.trigger_parameters.circleci.event_time", + "pipeline.trigger_parameters.webhook.body", + "pipeline.trigger_parameters.github_app.branch", + "pipeline.trigger_parameters.github_app.checkout_sha", + "pipeline.trigger_parameters.github_app.commit_sha", + "pipeline.trigger_parameters.github_app.commit_title", + "pipeline.trigger_parameters.github_app.commit_message", + "pipeline.trigger_parameters.github_app.commit_timestamp", + "pipeline.trigger_parameters.github_app.commit_author_name", + "pipeline.trigger_parameters.github_app.ref", + "pipeline.trigger_parameters.github_app.repo_name", + "pipeline.trigger_parameters.github_app.repo_url", + "pipeline.trigger_parameters.github_app.total_commits_count", + "pipeline.trigger_parameters.github_app.user_avatar", + "pipeline.trigger_parameters.github_app.user_id", + "pipeline.trigger_parameters.github_app.user_name", + "pipeline.trigger_parameters.github_app.user_username", + "pipeline.trigger_parameters.github_app.web_url", + "pipeline.trigger_parameters.gitlab.commit_sha", + "pipeline.trigger_parameters.gitlab.default_branch", + "pipeline.trigger_parameters.gitlab.x_gitlab_event_id", + "pipeline.trigger_parameters.gitlab.is_fork_merge_request", }, }, }