From 37f1acad5097a5021b4efd7505be1a4f4288a503 Mon Sep 17 00:00:00 2001
From: Pierre Smeyers <pierre.smeyers@gmail.com>
Date: Fri, 23 Aug 2024 09:13:54 +0200
Subject: [PATCH] fix: remove RENOVATE_PLATFORM as configurable param

---
 README.md                        | 47 ++++++++++++++++----------------
 kicker.json                      |  5 ----
 templates/gitlab-ci-renovate.yml |  8 ++----
 3 files changed, 26 insertions(+), 34 deletions(-)

diff --git a/README.md b/README.md
index d8e3a6f..f7389b5 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/).
 
 ## Usage
 
-This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component) 
+This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component)
 or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax.
 
 ### Use as a CI/CD component
@@ -24,21 +24,20 @@ Add the following to your `.gitlab-ci.yml`:
 ```yaml
 include:
   # include the template
-  - project: 'to-be-continuous/renovate'
-    ref: '1.2.2'
-    file: '/templates/gitlab-ci-renovate.yml'
+  - project: "to-be-continuous/renovate"
+    ref: "1.2.2"
+    file: "/templates/gitlab-ci-renovate.yml"
 ```
 
 ## Configuration
 
 The Renovate template uses some global configuration used throughout all jobs.
 
-| Input / Variable | Description                                                                     | Default value     |
-|------------------------|---------------------------------------------------------------------------------|-------------------|
-| `image` / `RENOVATE_IMAGE` | The Docker image used to run Renovate                                           | `registry.hub.docker.com/renovate/renovate:latest` |
-| `platform` / `RENOVATE_PLATFORM` | The Platform type of repository [See doc](https://docs.renovatebot.com/self-hosted-configuration/#platform)  | `gitlab` |
-| :lock: `RENOVATE_TOKEN`| A GitLab access token to allow Renovate crawl your projects. [See doc](https://docs.renovatebot.com/modules/platform/gitlab/#authentication) | _none_ |
-| :lock: `GITHUB_COM_TOKEN`| A GitHub access token to allow Renovate fetch changelogs. [See doc](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs) | _none_ |
+| Input / Variable           | Description                                                                                                                                               | Default value                                      |
+| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
+| `image` / `RENOVATE_IMAGE` | The Docker image used to run Renovate                                                                                                                     | `registry.hub.docker.com/renovate/renovate:latest` |
+| :lock: `RENOVATE_TOKEN`    | A GitLab access token to allow Renovate crawl your projects. [See doc](https://docs.renovatebot.com/modules/platform/gitlab/#authentication)              | _none_                                             |
+| :lock: `GITHUB_COM_TOKEN`  | A GitHub access token to allow Renovate fetch changelogs. [See doc](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs) | _none_                                             |
 
 This template will help you using [Renovate](https://www.mend.io/renovate/) from a GitLab project to
 automate your dependency updates within your groups or projects.
@@ -48,28 +47,28 @@ will be in charge of crawling all your other projects.
 Upon including the template, carefuly follow [Renovate's documentation](https://docs.renovatebot.com/) to
 configure the bot accordingly. Pay attention to the following:
 
-* ~~Remember to set the [platform](https://docs.renovatebot.com/self-hosted-configuration/#platform) parameter
+- ~~Remember to set the [platform](https://docs.renovatebot.com/self-hosted-configuration/#platform) parameter
   to `gitlab` in your configuration.~~
-* [GitLab platform integration](https://docs.renovatebot.com/modules/platform/gitlab/) requires that you
+- [GitLab platform integration](https://docs.renovatebot.com/modules/platform/gitlab/) requires that you
   declare a `RENOVATE_TOKEN` variable with an access token.
-* You'll also probaly need to declare a `GITHUB_COM_TOKEN` variable, holding a GitHub access token
+- You'll also probaly need to declare a `GITHUB_COM_TOKEN` variable, holding a GitHub access token
   (for [fetching changelogs](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs))
 
 ### Default Renovate configuration
 
-This template is designed to be run on GitLab. 
+This template is designed to be run on GitLab.
 
 Defaults values are set to manage GitLab features :
 
-| Renovate variable              | Value                                    |
-|--------------------------------|------------------------------------------|
-| [`RENOVATE_PLATFORM`](https://docs.renovatebot.com/self-hosted-configuration/#platform) | `gitlab`                         |
-| [`RENOVATE_ENDPOINT`](https://docs.renovatebot.com/self-hosted-configuration/#endpoint) | `$CI_API_V4_URL`                         |
-| [`RENOVATE_AUTODISCOVER_FILTER`](https://docs.renovatebot.com/self-hosted-configuration/#autodiscoverfilter) | `${CI_PROJECT_ROOT_NAMESPACE}/**`        |
-| [`RENOVATE_REGISTRY_ALIASES`](https://docs.renovatebot.com/configuration-options/#registryaliases) | `{"$$CI_SERVER_FQDN": "$CI_SERVER_FQDN"}`|
-| [`RENOVATE_BINARY_SOURCE`](https://docs.renovatebot.com/self-hosted-configuration/#binarysource) | `install`                                |
-| [`RENOVATE_LOG_FILE`](https://docs.renovatebot.com/config-overview/#logging-variables) | `renovate-log.ndjson`                    |
-| [`RENOVATE_LOG_FILE_LEVEL`](https://docs.renovatebot.com/config-overview/#logging-variables) | `debug`                                  |
+| Renovate variable                                                                                            | Value                                     |
+| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------- |
+| [`RENOVATE_PLATFORM`](https://docs.renovatebot.com/self-hosted-configuration/#platform)                      | `gitlab`                                  |
+| [`RENOVATE_ENDPOINT`](https://docs.renovatebot.com/self-hosted-configuration/#endpoint)                      | `$CI_API_V4_URL`                          |
+| [`RENOVATE_AUTODISCOVER_FILTER`](https://docs.renovatebot.com/self-hosted-configuration/#autodiscoverfilter) | `${CI_PROJECT_ROOT_NAMESPACE}/**`         |
+| [`RENOVATE_REGISTRY_ALIASES`](https://docs.renovatebot.com/configuration-options/#registryaliases)           | `{"$$CI_SERVER_FQDN": "$CI_SERVER_FQDN"}` |
+| [`RENOVATE_BINARY_SOURCE`](https://docs.renovatebot.com/self-hosted-configuration/#binarysource)             | `install`                                 |
+| [`RENOVATE_LOG_FILE`](https://docs.renovatebot.com/config-overview/#logging-variables)                       | `renovate-log.ndjson`                     |
+| [`RENOVATE_LOG_FILE_LEVEL`](https://docs.renovatebot.com/config-overview/#logging-variables)                 | `debug`                                   |
 
 ### Dry-run implementation details
 
@@ -83,5 +82,5 @@ The real dependency updates is triggered only when:
 
 In any other case (regular Git commit or else) the template will perform a dry run.
 
-:warning: Dry-run behavior is enabled/disabled with the `RENOVATE_DRY_RUN` environment variable. 
+:warning: Dry-run behavior is enabled/disabled with the `RENOVATE_DRY_RUN` environment variable.
 Please don't try to override it or you might break the default template implementation.
diff --git a/kicker.json b/kicker.json
index 9676a4b..2442ccf 100644
--- a/kicker.json
+++ b/kicker.json
@@ -20,11 +20,6 @@
       "name": "GITHUB_COM_TOKEN",
       "description": "A GitHub access token to allow Renovate fetch changelogs. [See doc](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs)",
       "secret": true
-    },
-    {
-      "name": "RENOVATE_PLATFORM",
-      "description": "The Platform type of repository",
-      "default": "gitlab"
     }
   ]
 }
diff --git a/templates/gitlab-ci-renovate.yml b/templates/gitlab-ci-renovate.yml
index fb4839b..43d6312 100644
--- a/templates/gitlab-ci-renovate.yml
+++ b/templates/gitlab-ci-renovate.yml
@@ -19,9 +19,6 @@ spec:
     image:
       description: The Docker image used to run Renovate
       default: registry.hub.docker.com/renovate/renovate:latest
-    platform:
-      description: The Platform type of repository
-      default: gitlab
 ---
 workflow:
   rules:
@@ -53,15 +50,16 @@ variables:
   TBC_TRACKING_IMAGE: registry.gitlab.com/to-be-continuous/tools/tracking:master
 
   RENOVATE_IMAGE: $[[ inputs.image ]]
-  RENOVATE_PLATFORM: $[[ inputs.platform ]]
 
   # those are native Renovate configuration variables
   # see: https://docs.renovatebot.com/self-hosted-configuration
+  RENOVATE_PLATFORM: gitlab
   RENOVATE_ENDPOINT: $CI_API_V4_URL
-  RENOVATE_LOG_FILE: renovate-log.ndjson
   RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/**
   RENOVATE_REGISTRY_ALIASES: "{\"$$CI_SERVER_FQDN\": \"$CI_SERVER_FQDN\"}"
   RENOVATE_BINARY_SOURCE: install
+  # see: https://docs.renovatebot.com/config-overview/#logging-variables
+  RENOVATE_LOG_FILE: renovate-log.ndjson
   RENOVATE_LOG_FILE_LEVEL: debug
   LOG_LEVEL: info
 
-- 
GitLab