From 44058fd17b4babc6998ec16c393e385138a5624c Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Tue, 17 Dec 2024 10:39:43 +0100 Subject: [PATCH] feat: add support matrix shortcode Added a support matrix shortcode to the policy guide to indicate which Git providers support specific features. This includes GitHub App, GitHub Webhook, Gitea, GitLab, Bitbucket Cloud, and Bitbucket Server. Update pull_request default template so that the dev can communicate it in the pull_request. Signed-off-by: Chmouel Boudjnah --- .github/pull_request_template.md | 11 +++++ docs/content/docs/guide/policy.md | 2 + docs/layouts/shortcodes/support_matrix.html | 49 +++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 docs/layouts/shortcodes/support_matrix.html diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 733415dcb..3beda36c8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -18,3 +18,14 @@ your descriptive commit message(s)! --> - [ ] 🎁 If feasible, please check if an end-to-end test can be added. See [README](https://github.com/openshift-pipelines/pipelines-as-code/blob/main/test/README.md) for more details. - [ ] 🔎 If there's any flakiness in the CI tests, don't necessarily ignore it. It's better to address the issue before merging, or provide a valid reason to bypass it if fixing isn't possible (e.g., token rate limitations). + +- If you are adding a provider feature, please fill up the following details which provider this feature supports: + + - [ ] GitHub + - [ ] GitHub Webhook + - [ ] Gitea + - [ ] Gitlab + - [ ] Bitbucket Cloud + - [ ] Bitbucket Server/DC + + (make sure to update the documentation accordingly) diff --git a/docs/content/docs/guide/policy.md b/docs/content/docs/guide/policy.md index 8141c37db..f56ce60c3 100644 --- a/docs/content/docs/guide/policy.md +++ b/docs/content/docs/guide/policy.md @@ -9,6 +9,8 @@ Pipelines-as-Code uses policies to control which actions can be performed by users who belong to specific teams within an organization, as defined on GitHub or other supported Git providers (currently GitHub and Gitea). +{{< support_matrix github_app="true" github_webhook="true" gitea="true" gitlab="false" bitbucket_cloud="false" bitbucket_server="false" >}} + ## Supported Actions * `pull_request` - This action triggers the CI in Pipelines-as-Code. Specifying diff --git a/docs/layouts/shortcodes/support_matrix.html b/docs/layouts/shortcodes/support_matrix.html new file mode 100644 index 000000000..e518e3112 --- /dev/null +++ b/docs/layouts/shortcodes/support_matrix.html @@ -0,0 +1,49 @@ +{{ $gitlabSupported := .Get "gitlab" }} {{ $githubAppSupported := .Get +"github_app" }} {{ $githubWebhookSupported := .Get "github_webhook" }} {{ +$giteaSupported := .Get "gitea" }} {{ $gitlabSupported := .Get "gitlab" }} {{ +$bitbucketCloudSupported := .Get "bitbucket_cloud" }} {{ +$bitbucketServerSupported := .Get "bitbucket_server" }} + +
+

This feature is supported on the following providers

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Git ProviderSupported
GitHub App{{ if eq $githubAppSupported "true" }}✅️{{ else }}❌️{{ end }}
GitHub Webhook + {{ if eq $githubWebhookSupported "true" }}✅️{{ else }}❌️{{ end }} +
Gitea{{ if eq $giteaSupported "true" }}✅️{{ else }}❌️{{ end }}
GitLab{{ if eq $gitlabSupported "true" }}✅️{{ else }}❌️{{ end }}
Bitbucket Cloud + {{ if eq $bitbucketCloudSupported "true" }}✅️{{ else }}❌️{{ end }} +
Bitbucket Server + {{ if eq $bitbucketServerSupported "true" }}✅️{{ else }}❌️{{ end }} +
+