question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

option to enable CI/CD checks

See original GitHub issue

Hi!

I have a scheduled job for model re-training and integrated CML to simplify running a DVC pipeline and creating a PR within Github Actions. For example, once a week a job is triggered and in the end I see a new PR with model results. I would like to run some pre-configured checks for the newly created PR, however, they do not run as per docs. I thought that the checks are disabled for the first created with cml pr commit, but even a manual second commit does not trigger jobs. Is it because of CML? If so, can this behavior be toggle-able?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
RadionBikcommented, Nov 16, 2021

Hi!

After many trials and errors we have managed to retrieve and integrate github application token within our CML workflow. Here is an excerpt from the yaml:

container: docker://ghcr.io/iterative/cml:0-dvc2-base1
    steps:
      - uses: navikt/github-app-token-generator@v1
        id: get-token
        with:
          private-key: ${{ secrets.CML_GITHUB_APP_PEM }}
          app-id: ${{ secrets.CML_GITHUB_APP_ID }}

      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: ${{ steps.get-token.outputs.token }}


        ...

A potential pitfall is setting proper permissions for the app, once it is done, the rest part is easy.

P.S. I think it would be great to have the information from this issue in the docs

3reactions
DavidGOrtegacommented, Nov 4, 2021

@RadionBik as @dacbd states cml pr avoids the CI run to avoid infinite CI executions (one PR would generate another PR)

A solution might be trigger it with

on:
  issue_comment:
    types: [created]

jobs:
  pr-checks:
    if: startsWith(github.event.comment.body, '/pr-checks')

Then after generating the pr

echo '/pr-checks' > action.md
cml send-comment --commit-sha HEAD --pr action.md
Read more comments on GitHub >

github_iconTop Results From Across the Web

Disabling GitLab CI/CD
Enable CI/CD in a project · On the top bar, select Main menu > Projects and find your project. · On the left...
Read more >
Creating CI tests with the Checks API - GitHub Docs
The Checks API allows you to set up CI tests that are automatically run against each code commit in a repository. The Checks...
Read more >
CI/CD pipelines explained: Everything you need to know
Planning to implement CI/CD? This comprehensive guide explores the stages of a CI/CD pipeline, its pros and cons, best practices and more.
Read more >
CI/CD Pipeline: A Gentle Introduction - Semaphore
A CI/CD pipeline helps you automate steps in your software delivery process. Understand the basics, best practices and how to get started.
Read more >
Pipeline deployment approvals - Azure - Microsoft Learn
Checks enable the resource owner to control if and when a stage in any pipeline can consume a resource. As an owner of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found