Skip to content

fix: save CI time and run checks conditionally#13507

Closed
alexmt wants to merge 2 commits intoargoproj:masterfrom
alexmt:conditional-ci
Closed

fix: save CI time and run checks conditionally#13507
alexmt wants to merge 2 commits intoargoproj:masterfrom
alexmt:conditional-ci

Conversation

@alexmt
Copy link
Copy Markdown
Collaborator

@alexmt alexmt commented May 9, 2023

PR changes CI to run backend/frontend changes only if the commit touches related files. Doc changes would skip Golang/typescript changes altogether.

@alexmt alexmt force-pushed the conditional-ci branch 8 times, most recently from bc382ed to 0aa3baa Compare May 10, 2023 05:17
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
@morey-tech
Copy link
Copy Markdown
Contributor

I suspect this will be blocked until we figure out how to pass the required checks even when there are skipped.

GitHub docs have an example when using on.pull_request.paths to filter. You might be able to implement something similar; a workflow with the same name and job names that return true.

@morey-tech
Copy link
Copy Markdown
Contributor

Something to the effect of:

# Stub for required checks that only runs for docs PRs
name: Integration tests
on: 
  push:
    branches:
      - 'master'
      - 'release-*'
      - '!release-1.4'
      - '!release-1.5'
    paths:
      - '**/*.md'
  pull_request:
    branches:
      - 'master'
      - 'release-*'
    paths:
      - '**/*.md'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  check-go:
    name: Ensure Go modules synchronicity
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  build-go:
    name: Build & cache Go code
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  lint-go:
    name: Lint Go code
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  test-go:
    name: Run unit tests for Go packages
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  test-go-race:
    name: Run unit tests with -race, for Go packages
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  codegen:
    name: Check changes to generated code
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  build-ui:
    name: Build, test & lint UI code
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  analyze:
    name: Process & analyze test artifacts
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

  test-e2e:
    name: Run end-to-end tests
    runs-on: ubuntu-latest
    steps:
      - run: 'echo "No build required"'

@todaywasawesome
Copy link
Copy Markdown
Contributor

@morey-tech do you want to add that as a suggestion on the PR?

blakepettersson added a commit to blakepettersson/argo-cd that referenced this pull request Jan 24, 2024
This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
ishitasequeira added a commit that referenced this pull request Feb 6, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see #16706 and #13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
JulienFuix pushed a commit to JulienFuix/argo-cd that referenced this pull request Feb 12, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
clement-heetch pushed a commit to clement-heetch/argo-cd that referenced this pull request Feb 12, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
adriananeci pushed a commit to adriananeci/argo-cd that referenced this pull request Feb 25, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Adrian Aneci <aneci@adobe.com>
penglongli pushed a commit to penglongli/argo-cd that referenced this pull request Mar 6, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: penglongli <pelenli@tencent.com>
lyda pushed a commit to lyda/argo-cd that referenced this pull request Mar 28, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Kevin Lyda <kevin@lyda.ie>
mkieweg pushed a commit to mkieweg/argo-cd that referenced this pull request Jun 11, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
@kencochrane
Copy link
Copy Markdown

This PR has been in draft form for over a year. Should we delete it or consider what it would take to merge it?

Hariharasuthan99 pushed a commit to AmadeusITGroup/argo-cd that referenced this pull request Jun 16, 2024
* chore(ci): run ci checks conditionally

This should prevent docs changes from having the need to run e2e tests
etc, and prevent backend changes from needing to run ui tests, and vice
versa.

This is similar to previous attempts (see argoproj#16706 and argoproj#13507), with the
difference here that we add the if checks on each _step_ rather than
each _job_ - the reason being that most of these jobs are required, and
if we skip whole jobs any PR which does this will be left hanging
indefinitely, so Github forces us to do this on a step level instead.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): run ci checks conditionally

Try conditional jobs, according to https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore(ci): add composite test-e2e action

This is a workaround for the e2e tests which do not run yet report `pending` when they are actually skipped.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
@blakepettersson
Copy link
Copy Markdown
Member

This was implemented with #17180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants