From 2fa3ec81973e72f2722ea9a298bc5f10aeeef2cf Mon Sep 17 00:00:00 2001 From: justusbunsi Date: Sat, 14 May 2022 01:10:07 +0200 Subject: [PATCH] Prepare Helm Chart release - Auto-generate parameters documentation - Provide required `make` commands - Update contribution environment to match new requirements Signed-off-by: Steven Kriegler --- .gitignore | 2 + CONTRIBUTING.md | 20 +- Makefile | 12 ++ README.md | 5 + contrib/Dockerfile | 7 +- helm/.helmignore | 1 + helm/README.md | 79 ++++++++ helm/readme-generator-config.json | 19 ++ helm/values.yaml | 130 +++++++++---- package-lock.json | 307 ++++++++++++++++++++++++++++++ package.json | 23 +++ 11 files changed, 564 insertions(+), 41 deletions(-) create mode 100644 helm/README.md create mode 100644 helm/readme-generator-config.json create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore index c62d6fe..a3538d3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ /.scannerwork/ /config/ /vendor/ +/node_modules/ +/helm-releases/ /gitea-sonarqube-bot /coverage.html /*.log diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 585a9f1..c14df07 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,7 @@ - [Setup development environment](#setup-development-environment) - [Build and Run](#build-and-run) - [Testing](#testing) + - [Helm Chart](#helm-chart) - [Release](#release) - [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco) @@ -40,6 +41,15 @@ make test make coverage ``` +## Helm Chart + +The [Parameters section](helm/README.md#parameters) is auto-generated using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm). +When modifying anything in the `helm` directory, remember to update the documentation by running + +```bash +make helm-params +``` + ## Release For local purposes @@ -48,13 +58,21 @@ For local purposes docker build -t gitea-sonarqube-pr-bot/prod . ``` -For actual release builds +**Docker image** ```bash docker build -t justusbunsi/gitea-sonarqube-bot:$TAG . docker push justusbunsi/gitea-sonarqube-bot:$TAG ``` +**Helm Chart** + +```bash +make helm-pack +``` + +Use the two files in `helm-releases` and push them to the `charts` branch. + ## Developer Certificate of Origin (DCO) I consider the act of contributing to the code by submitting a Pull Request as the "Sign off" or agreement to the diff --git a/Makefile b/Makefile index edf1d01..9277ba6 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ help: @echo " - test p=./path/to/package Run test suite for specific package" @echo " - test\#SpecificTestName Run a specific" @echo " - coverage Run full test suite and generates coverage report as HTML file" + @echo " - helm-params Auto-generates 'Parameters' section of 'helm/README.md' based on comments in values.yaml" + @echo " - helm-pack Prepares Helm Chart release artifacts for pushing to 'charts' branch" @echo " - dep Dependency maintenance (tidy, vendor, verify)" @echo " - vet Examine Go source code and reports suspicious parts" @echo " - fmt Format the Go code" @@ -44,6 +46,16 @@ coverage: go test -coverprofile=cover.out ./... go tool cover -html=cover.out -o cover.html +helm-params: + npm install + npm run helm-params + +helm-pack: + rm -rf ./helm-releases/ + helm package ./helm/ -d ./helm-releases/ + curl -L -o ./helm-releases/index.yaml https://codeberg.org/justusbunsi/gitea-sonarqube-bot/raw/branch/charts/index.yaml + helm repo index ./helm-releases/ --url https://codeberg.org/justusbunsi/gitea-sonarqube-bot/raw/branch/charts/ --merge ./helm-releases/index.yaml + dep: go mod tidy go mod vendor diff --git a/README.md b/README.md index d5b4ff9..4aa37ed 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Luckily, both endpoints have a proper REST API to communicate with each others. - [Bot configuration](#bot-configuration) - [Installation](#installation) - [Docker](#docker) + - [Helm Chart](#helm-chart) - [Setup](#setup) - [SonarQube](#sonarqube) - [Gitea](#gitea) @@ -58,6 +59,10 @@ and execute the following (replace `$TAG` first): docker run --rm -it -p 9000:3000 -v "$(pwd)/config/:/home/bot/config/" justusbunsi/gitea-sonarqube-bot:$TAG ``` +### Helm Chart + +See [Helm Chart README](helm/README.md) for detailed instructions. + ## Setup ### SonarQube diff --git a/contrib/Dockerfile b/contrib/Dockerfile index 8d06f64..0894d1d 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -1,6 +1,11 @@ FROM golang:1.17-alpine3.14 -RUN apk --no-cache add build-base git bash +RUN apk --no-cache add build-base git bash curl openssl npm + +RUN curl -fsSL -o ./get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \ + && chmod 700 ./get_helm.sh \ + && ./get_helm.sh \ + && rm ./get_helm.sh WORKDIR /projects diff --git a/helm/.helmignore b/helm/.helmignore index 0e8a0eb..242d656 100644 --- a/helm/.helmignore +++ b/helm/.helmignore @@ -21,3 +21,4 @@ .idea/ *.tmproj .vscode/ +readme-generator-config.json diff --git a/helm/README.md b/helm/README.md new file mode 100644 index 0000000..ab8c709 --- /dev/null +++ b/helm/README.md @@ -0,0 +1,79 @@ +# Gitea SonarQube Bot + +## Installation + +```bash +helm repo add gitea-sonarqube-bot https://codeberg.org/justusbunsi/gitea-sonarqube-bot/raw/branch/charts/ +helm repo update +helm install gitea-sonarqube-bot gitea-sonarqube-bot/gitea-sonarqube-bot +``` + +You have to modify the `app.configuration` values. Otherwise, the bot won't start as it tries to establish a connection +to your Gitea instance. See [config.example.yaml](https://codeberg.org/justusbunsi/gitea-sonarqube-bot/src/branch/main/config/config.example.yaml) +for full configuration options. + +## Parameters + +### Common parameters + +| Name | Description | Value | +| -------------------- | -------------------------------------------------------------------------------------------- | --------------------------------- | +| `replicaCount` | Number of replicas for the bot | `1` | +| `image.repository` | Image repository | `justusbunsi/gitea-sonarqube-bot` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.tag` | Image tag (Overrides the image tag whose default is the chart `appVersion`) | `""` | +| `imagePullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `nameOverride` | String to partially override common.names.fullname template (will maintain the release name) | `""` | +| `fullnameOverride` | String to fully override common.names.fullname template | `""` | +| `resources.limits` | The resources limits for the container | `{}` | +| `resources.requests` | The requested resources for the container | `{}` | +| `nodeSelector` | Node labels for pod assignment. Evaluated as a template. | `{}` | +| `tolerations` | Tolerations for pod assignment. Evaluated as a template. | `[]` | +| `affinity` | Affinity for pod assignment. Evaluated as a template. | `{}` | +| `podAnnotations` | Pod annotations. | `{}` | + + +### App parameters + +| Name | Description | Value | +| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| `app.configuration.gitea.url` | Endpoint of your Gitea instance. Must be expandable by '/api/v1' to form the API base path as shown in Swagger UI. | `""` | +| `app.configuration.gitea.token.value` | Gitea token as plain text. Can be replaced with `file` key containing path to file. | `""` | +| `app.configuration.sonarqube.url` | Endpoint of your SonarQube instance. Must be expandable by '/api' to form the API base path. | `""` | +| `app.configuration.sonarqube.token.value` | SonarQube token as plain text. Can be replaced with `file` key containing path to file. | `""` | +| `app.configuration.sonarqube.additionalMetrics` | Setting this option you can extend that default list by your own metrics. | `[]` | +| `app.configuration.projects[0].sonarqube.key` | Project key inside SonarQube | `""` | +| `app.configuration.projects[0].gitea.owner` | Repository owner inside Gitea | `""` | +| `app.configuration.projects[0].gitea.name` | Repository name inside Gitea | `""` | +| `volumes` | If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly | `[]` | +| `volumeMounts` | If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly | `[]` | + + +### Security parameters + +| Name | Description | Value | +| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------ | +| `serviceAccount.create` | Specifies whether a service account should be created | `true` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `""` | +| `podSecurityContext.fsGroup` | Group ID for the container | `1000` | +| `securityContext.readOnlyRootFilesystem` | Mounts the container's root filesystem as read-only | `true` | +| `securityContext.runAsNonRoot` | Avoid running as root user | `true` | +| `securityContext.runAsUser` | User ID for the container | `1000` | + + +### Traffic exposure parameters + +| Name | Description | Value | +| ------------------------------------ | ------------------------------------------------------------------------------------- | ------------------------ | +| `service.type` | Service type | `ClusterIP` | +| `service.port` | Service port | `80` | +| `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.className` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` | +| `ingress.annotations` | Additional annotations for the Ingress resource. | `{}` | +| `ingress.hosts[0].host` | Host for the ingress resource | `sqbot.example.com` | +| `ingress.hosts[0].paths[0].path` | The path to the bot endpoint | `/` | +| `ingress.hosts[0].paths[0].pathType` | Ingress path type | `ImplementationSpecific` | +| `ingress.tls` | The tls configuration for additional hostnames to be covered with configured ingress. | `[]` | + + diff --git a/helm/readme-generator-config.json b/helm/readme-generator-config.json new file mode 100644 index 0000000..a0ade9c --- /dev/null +++ b/helm/readme-generator-config.json @@ -0,0 +1,19 @@ +{ + "comments": { + "format": "#" + }, + "tags": { + "param": "@param", + "section": "@section", + "skip": "@skip", + "extra": "@extra" + }, + "modifiers": { + "array": "array", + "object": "object", + "string": "string" + }, + "regexp": { + "paramsSectionTitle": "Parameters" + } +} diff --git a/helm/values.yaml b/helm/values.yaml index aec6e51..6ac32a8 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -1,25 +1,68 @@ -# Default values for helm. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +# @section Common parameters +# @param replicaCount Number of replicas for the bot replicaCount: 1 +# ref: https://hub.docker.com/r/justusbunsi/gitea-sonarqube-bot/tags/ +# @param image.repository Image repository +# @param image.pullPolicy Image pull policy +# @param image.tag Image tag (Overrides the image tag whose default is the chart `appVersion`) image: repository: justusbunsi/gitea-sonarqube-bot pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. tag: "" +# @param imagePullSecrets Specify docker-registry secret names as an array +imagePullSecrets: [] + +# @param nameOverride String to partially override common.names.fullname template (will maintain the release name) +nameOverride: "" + +# @param fullnameOverride String to fully override common.names.fullname template +fullnameOverride: "" + +# We usually recommend not to specify default resources and to leave this as a conscious +# choice for the user. This also increases chances charts run on environments with little +# resources, such as Minikube. If you do want to specify resources, uncomment the following +# lines, adjust them as necessary, and remove the curly braces after 'resources:'. +# @param resources.limits The resources limits for the container +# @param resources.requests The requested resources for the container +resources: + limits: {} + # cpu: 100m + # memory: 128Mi + requests: {} + # cpu: 100m + # memory: 128Mi + +# @param nodeSelector Node labels for pod assignment. Evaluated as a template. +# ref: https://kubernetes.io/docs/user-guide/node-selection/ +nodeSelector: {} + +# @param tolerations Tolerations for pod assignment. Evaluated as a template. +# ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +tolerations: [] + +# @param affinity Affinity for pod assignment. Evaluated as a template. +# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +affinity: {} + +# @param podAnnotations Pod annotations. +podAnnotations: {} + +# @section App parameters + app: - # This object represents the config.yaml provided to the application + # This object represents the [config.yaml](https://codeberg.org/justusbunsi/gitea-sonarqube-bot/src/branch/main/config/config.example.yaml) provided to the application. configuration: # Gitea related configuration. Necessary for adding/updating comments on repository pull requests gitea: - # Endpoint of your Gitea instance. Must be expandable by '/api/v1' to form the API base path as shown in Swagger UI. + # @param app.configuration.gitea.url Endpoint of your Gitea instance. Must be expandable by '/api/v1' to form the API base path as shown in Swagger UI. url: "" # Created access token for the user that shall be used as bot account. # User needs "Read project" permissions with access to "Pull Requests" + # @param app.configuration.gitea.token.value Gitea token as plain text. Can be replaced with `file` key containing path to file. token: value: "" # # or path to file containing the plain text secret @@ -29,6 +72,7 @@ app: # request will be ignored. # The bot looks for `X-Gitea-Signature` header containing the sha256 hmac hash of the plain text secret. If the header # exists and no webhookSecret is defined here, the bot will ignore the request, because it cannot be validated. + # @skip app.configuration.gitea.webhook webhook: secret: "" # # or path to file containing the plain text secret @@ -36,11 +80,12 @@ app: # SonarQube related configuration. Necessary for requesting data from the API and processing the webhook. sonarqube: - # Endpoint of your SonarQube instance. Must be expandable by '/api' to form the API base path. + # @param app.configuration.sonarqube.url Endpoint of your SonarQube instance. Must be expandable by '/api' to form the API base path. url: "" # Created access token for the user that shall be used as bot account. # User needs "Browse on project" permissions + # @param app.configuration.sonarqube.token.value SonarQube token as plain text. Can be replaced with `file` key containing path to file. token: value: "" # # or path to file containing the plain text secret @@ -51,6 +96,7 @@ app: # The bot looks for `X-Sonar-Webhook-HMAC-SHA256` header containing the sha256 hmac hash of the plain text secret. # If the header exists and no webhookSecret is defined here, the bot will ignore the request, because it cannot be # validated. + # @skip app.configuration.sonarqube.webhook webhook: secret: "" # # or path to file containing the plain text secret @@ -58,12 +104,15 @@ app: # Some useful metrics depend on the edition in use. There are various ones like code_smells, vulnerabilities, bugs, etc. # By default the bot will extract "bugs,vulnerabilities,code_smells" - # Setting this option you can extend that default list by your own metrics. + # @param app.configuration.sonarqube.additionalMetrics Setting this option you can extend that default list by your own metrics. additionalMetrics: [] # - "new_security_hotspots" # List of project mappings to take care of. Webhooks for other projects will be ignored. # At least one must be configured. Otherwise all webhooks (no matter which source) because the bot cannot map on its own. + # @param app.configuration.projects[0].sonarqube.key Project key inside SonarQube + # @param app.configuration.projects[0].gitea.owner Repository owner inside Gitea + # @param app.configuration.projects[0].gitea.name Repository name inside Gitea projects: - sonarqube: key: "" @@ -73,7 +122,7 @@ app: owner: "" name: "" -# If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly +# @param volumes If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly volumes: [] # - name: gitea-connection # secret: @@ -82,7 +131,7 @@ volumes: [] # secret: # secretName: sonarqube-secret-with-token-and-maybe-webhook-secret -# If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly +# @param volumeMounts If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly volumeMounts: [] # - name: gitea-connection # readOnly: true @@ -91,24 +140,25 @@ volumeMounts: [] # readOnly: true # mountPath: "/bot/secrets/sonarqube/" -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" +# @section Security parameters serviceAccount: - # Specifies whether a service account should be created + # @param serviceAccount.create Specifies whether a service account should be created create: true - # Annotations to add to the service account + # @param serviceAccount.annotations Annotations to add to the service account annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template + # @param serviceAccount.name The name of the service account to use. If not set and create is true, a name is generated using the fullname template name: "" -podAnnotations: {} - +# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod +# @param podSecurityContext.fsGroup Group ID for the container podSecurityContext: fsGroup: 1000 +# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container +# @param securityContext.readOnlyRootFilesystem Mounts the container's root filesystem as read-only +# @param securityContext.runAsNonRoot Avoid running as root user +# @param securityContext.runAsUser User ID for the container securityContext: # capabilities: # drop: @@ -117,40 +167,42 @@ securityContext: runAsNonRoot: true runAsUser: 1000 +# @section Traffic exposure parameters + +# @param service.type Service type +# @param service.port Service port service: type: ClusterIP port: 80 +# ref: https://kubernetes.io/docs/user-guide/ingress/ ingress: + + # @param ingress.enabled Enable ingress controller resource enabled: false + + # @param ingress.className IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) + # This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster. + # ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ className: "" + + # @param ingress.annotations Additional annotations for the Ingress resource. annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" + + # @param ingress.hosts[0].host Host for the ingress resource + # @param ingress.hosts[0].paths[0].path The path to the bot endpoint + # @param ingress.hosts[0].paths[0].pathType Ingress path type hosts: - host: sqbot.example.com paths: - path: / pathType: ImplementationSpecific + + # @param ingress.tls The tls configuration for additional hostnames to be covered with configured ingress. + # see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls tls: [] - # - secretName: chart-example-tls - # hosts: + # - hosts: # - sqbot.example.com - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} + # secretName: chart-example-tls diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..06f1dff --- /dev/null +++ b/package-lock.json @@ -0,0 +1,307 @@ +{ + "name": "gitea-sonarqube-pr-bot", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "gitea-sonarqube-pr-bot", + "license": "MIT", + "dependencies": { + "readme-generator-for-helm": "^1.3.1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "node_modules/dot-object": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.4.tgz", + "integrity": "sha512-7FXnyyCLFawNYJ+NhkqyP9Wd2yzuo+7n9pGiYpkmXCTYa8Ci2U0eUNDVg5OuO5Pm6aFXI2SWN8/N/w7SJWu1WA==", + "dependencies": { + "commander": "^4.0.0", + "glob": "^7.1.5" + }, + "bin": { + "dot-object": "bin/dot-object" + } + }, + "node_modules/dot-object/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "node_modules/glob": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.2.tgz", + "integrity": "sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "dependencies": { + "repeat-string": "^1.0.0" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readme-generator-for-helm": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/readme-generator-for-helm/-/readme-generator-for-helm-1.3.1.tgz", + "integrity": "sha512-3esincvKfR32K+xdxbYXcDG2bhiPSJdmie4dDFJxEu2Y93Dm8xPoDn7ieppyEpSiTBKiIYBBfE6BwHW2HE/j+A==", + "dependencies": { + "commander": "^7.1.0", + "dot-object": "^2.1.4", + "lodash": "^4.17.21", + "markdown-table": "^2.0.0", + "yaml": "^2.0.0-3" + }, + "bin": { + "readme-generator": "bin/index.js" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/yaml": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.0.1.tgz", + "integrity": "sha512-1NpAYQ3wjzIlMs0mgdBmYzLkFgWBIWrzYVDYfrixhoFNNgJ444/jT2kUT2sicRbJES3oQYRZugjB6Ro8SjKeFg==", + "engines": { + "node": ">= 14" + } + } + }, + "dependencies": { + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "dot-object": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.4.tgz", + "integrity": "sha512-7FXnyyCLFawNYJ+NhkqyP9Wd2yzuo+7n9pGiYpkmXCTYa8Ci2U0eUNDVg5OuO5Pm6aFXI2SWN8/N/w7SJWu1WA==", + "requires": { + "commander": "^4.0.0", + "glob": "^7.1.5" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.2.tgz", + "integrity": "sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "requires": { + "repeat-string": "^1.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "readme-generator-for-helm": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/readme-generator-for-helm/-/readme-generator-for-helm-1.3.1.tgz", + "integrity": "sha512-3esincvKfR32K+xdxbYXcDG2bhiPSJdmie4dDFJxEu2Y93Dm8xPoDn7ieppyEpSiTBKiIYBBfE6BwHW2HE/j+A==", + "requires": { + "commander": "^7.1.0", + "dot-object": "^2.1.4", + "lodash": "^4.17.21", + "markdown-table": "^2.0.0", + "yaml": "^2.0.0-3" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "yaml": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.0.1.tgz", + "integrity": "sha512-1NpAYQ3wjzIlMs0mgdBmYzLkFgWBIWrzYVDYfrixhoFNNgJ444/jT2kUT2sicRbJES3oQYRZugjB6Ro8SjKeFg==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ec6ef0a --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "gitea-sonarqube-pr-bot", + "description": "Integrate SonarQube analysis into Gitea Pull Requests", + "author": "Steven Kriegler ", + "license": "MIT", + "private": true, + "repository": { + "type": "git", + "url": "https://codeberg.org/justusbunsi/gitea-sonarqube-bot.git" + }, + "keywords": [ + "gitea", + "sonarqube", + "pull request", + "bot" + ], + "scripts": { + "helm-params": "cd node_modules/readme-generator-for-helm && node bin/index.js --config ./../../helm/readme-generator-config.json --readme ./../../helm/README.md --values ./../../helm/values.yaml" + }, + "dependencies": { + "readme-generator-for-helm": "^1.3.1" + } +}