-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add PR locking configuration at the digger.yml level #1578
Add PR locking configuration at the digger.yml level #1578
Conversation
8d86830
to
8300ad1
Compare
8300ad1
to
a711c5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Overall looks good and I'm happy about the naming.
We also need to override locking to be noopLock if this flag is set for backendless mode here:
digger/cli/pkg/github/github.go
Line 214 in 1d611b4
diggerConfig, diggerConfigYaml, dependencyGraph, err := digger_config.LoadDiggerConfig("./", true, nil) |
backend/controllers/github.go
Outdated
if err != nil { | ||
utils.InitCommentReporter(ghService, prNumber, fmt.Sprintf(":x: Failed perform lock action on project: %v %v", project.Name, err)) | ||
return fmt.Errorf("failed to perform lock action on project: %v, %v", project.Name, err) | ||
if dg_configuration.PrLocks{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to use the config object here:
if dg_configuration.PrLocks{ | |
if config.PrLocks{ |
backend/controllers/github.go
Outdated
if err != nil { | ||
utils.InitCommentReporter(ghService, prNumber, fmt.Sprintf(":x: Failed perform lock action on project: %v %v", project.Name, err)) | ||
return fmt.Errorf("failed to perform lock action on project: %v, %v", project.Name, err) | ||
if dg_configuration.PrLocks{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to do the same if statement in the handleIssueComment
webhook handler in the same file
I added support for |
7e2dbd2
to
9695050
Compare
Hey @evanstachowiak this looks great, thanks! I would rather not have a flag on the PrLock interface. We have a NoopLock interface implemented here: digger/libs/locking/locking.go Line 36 in e43db33
so if you had something like
here it will do the trick - since that path is outside of the orchestrator path. |
@evanstachowiak actually thinking about it again, your changes will work well, the enable flag works. Future refactoring can be done but this is good enough for now! |
Following the conversation here https://diggertalk.slack.com/archives/C01DVJRK6CX/p1718200181031169.
Adding the ability to enable/disable PR locking in GitHub with a digger.yml config setting.
Addresses this issue: #1577