Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add test for uncommitted changes in deploy directory #4759

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ permissions:
contents: read

jobs:
uncommitted-code-check:
name: uncommitted-code-check
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Check generated deploy code
run: make generate-deploy

- name: Check for uncommitted changes
run: make check-all-committed

- name: Show the uncommitted "git diff"
if: ${{ failure() }}
run: git diff ; false
e2e-build-test:
name: e2e-build-test
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ queue_rules:
- "status-success=golangci-lint"
- "status-success=mod-check"
- "status-success=lint-extras"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29"
Expand Down Expand Up @@ -72,6 +73,7 @@ queue_rules:
- "status-success=golangci-lint"
- "status-success=mod-check"
- "status-success=lint-extras"
- "status-success=uncommitted-code-check"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we are backporting this to release-v3.11 branch, can you please update the mergify rules for the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a rule for base branch release-v3.11 it is only for all release branches or v3.10 individually.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I add it under base~=^(release-.+)$ check, and we only backport to release-v3.11 branch won't that cause the CI in other older branches to fail?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are maintaining only 3.10 and 3.11 branches nothing else.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please do it in above 3 places i pointed out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed the other places.
Added them now.

- "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29"
Expand Down Expand Up @@ -187,6 +189,7 @@ pull_request_rules:
- "status-success=lint-extras"
- "status-success=mod-check"
- "status-success=multi-arch-build"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29"
Expand Down Expand Up @@ -274,6 +277,7 @@ pull_request_rules:
- "status-success=mod-check"
- "status-success=lint-extras"
- "#changes-requested-reviews-by=0"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ generate-deploy:
go mod vendor
$(MAKE) -C deploy

.PHONY: check-all-committed
check-all-committed: ## Fail in case there are uncommitted changes
test -z "$(shell git status --short)" || (echo "files were modified: " ; git status --short ; false)

#
# e2e testing by compiling e2e.test in case it does not exist and running the
# executable. The e2e.test executable is not checked as a dependency in the
Expand Down