Skip to main content

Make comment on gitlab using `flux-local` diff outputs.

Project description

GitlabBot

Flux-local

Bot User

Setup your bot account and generate a PAT token. Then, add the bot to your project with the reporter permission. Finally , store the pat token in the GITLAB_BOT_PAT CI/CD variable.

CI

You can use the following content to setup GitLab CI to post the diff comment.

---
.flux-local-diff:
  stage: flux-local
  image:
    name: ghcr.io/alexsaphir/gitlabbot:v0.2.8
  parallel:
    matrix:
      - FLUX_RESOURCE:
          - hr
          - ks
  variables:
    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
    CONFIG_FILE: '.gitlabbot.yaml'
  script:
    - |
      DIFF="dyff between --omit-header --ignore-order-changes -o gitlab" \
      flux-local diff $FLUX_RESOURCE -A \
      --path $CLUSTER_PATH \
      --branch-orig main \
      --strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart" \
      --output-file out.diff
    - |
      gitlab-comment --diff_file out.diff \
        --flux_resource $FLUX_RESOURCE \
        --diff_mode dyff \
        --comment_mode $COMMENT_MODE
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

flux-local-diff:
  extends: .flux-local-diff
  variables:
    CLUSTER_PATH: cluster
    COMMENT_MODE: recreate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitlabbot-0.3.5.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitlabbot-0.3.5-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file gitlabbot-0.3.5.tar.gz.

File metadata

  • Download URL: gitlabbot-0.3.5.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitlabbot-0.3.5.tar.gz
Algorithm Hash digest
SHA256 4a5e5c1a529d14be1f0f04bdb2831f009dc061aafa2a907a8503d7f0395cf303
MD5 18ecfca27c0492cb9a34b7c54db7d229
BLAKE2b-256 cb51013820cd569d3748091435608785cfbe1cdd8019d08c99956f1e62897c1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitlabbot-0.3.5.tar.gz:

Publisher: publish.yaml on Alexsaphir/GitlabBot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gitlabbot-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: gitlabbot-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitlabbot-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0c1bd3415fdf42fe7668d02285b0c24560e1df1401962607effc0fd0fe654ba3
MD5 2ef415f980f35be46d073e5f981bca11
BLAKE2b-256 a9c18ef98af80268a3785bf9443ede0f84b986d04168b1d7b69151760cca6ed0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitlabbot-0.3.5-py3-none-any.whl:

Publisher: publish.yaml on Alexsaphir/GitlabBot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page