-
-
Notifications
You must be signed in to change notification settings - Fork 248
feat: add pre-deploy hook for GitOps project syncs #3022
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8b9b9e8
chore: enforce LF for husky hooks, Justfile, and shell scripts
peitschie 53fba62
feat(lifecycle): pre-deploy hook backend for gitops syncs
peitschie 9689a57
feat(lifecycle): pre-deploy hook UI for gitops syncs
peitschie 3085942
review(lifecycle): suffix new unexported helpers with Internal
peitschie ca9dd56
review(gitops): drop duplicate-return branches in redeploy error paths
peitschie c51d7a6
review(lifecycle): drop double-truncation of persisted hook output
peitschie 23b52af
review(lifecycle): gate pre-deploy hook config behind gitops:lifecycle
peitschie 7790e46
review(gitops): move redeploy-after-sync error to common/errors.go
peitschie d90af1e
ui and fixes
kmendell 2570738
cr
kmendell 211bb9f
Merge remote-tracking branch 'origin/main' into feat/lifecycle-hooks
kmendell 0183bc2
Merge remote-tracking branch 'origin/main' into feat/lifecycle-hooks
kmendell bcbf4e7
cr
kmendell c1b318e
fix migration
kmendell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Files that must be LF on disk regardless of the checkout platform, because | ||
| # they're consumed by tooling that chokes on CRLF (bash shebangs, just, | ||
| # shell scripts copied verbatim into Linux runner containers). | ||
| .husky/* text eol=lf | ||
| .husky/_/* text eol=lf | ||
| Justfile text eol=lf | ||
| *.sh text eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package common | ||
|
|
||
| import ( | ||
| "errors" | ||
| "io" | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestRedeployAfterSyncFailedErrorZeroValue(t *testing.T) { | ||
| err := &RedeployAfterSyncFailedError{} | ||
|
|
||
| if got := err.Error(); got != "redeploy failed" { | ||
| t.Fatalf("Error() = %q, want %q", got, "redeploy failed") | ||
| } | ||
|
|
||
| if errors.Is(err, io.EOF) { | ||
| t.Fatal("errors.Is matched an unrelated error") | ||
| } | ||
| } | ||
|
|
||
| func TestRedeployAfterSyncFailedErrorNilReceiver(t *testing.T) { | ||
| var err *RedeployAfterSyncFailedError | ||
|
|
||
| if got := err.Error(); got != "redeploy failed" { | ||
| t.Fatalf("Error() = %q, want %q", got, "redeploy failed") | ||
| } | ||
|
|
||
| if got := err.Unwrap(); got != nil { | ||
| t.Fatalf("Unwrap() = %v, want nil", got) | ||
| } | ||
| } | ||
|
|
||
| func TestRedeployAfterSyncFailedErrorWrapsErr(t *testing.T) { | ||
| cause := io.EOF | ||
| err := &RedeployAfterSyncFailedError{Err: cause} | ||
|
|
||
| if got := err.Error(); got != "redeploy failed: EOF" { | ||
| t.Fatalf("Error() = %q, want %q", got, "redeploy failed: EOF") | ||
| } | ||
|
|
||
| if !errors.Is(err, cause) { | ||
| t.Fatal("errors.Is did not match wrapped error") | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.