-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Implement auto-cancellation of concurrent jobs if the event is push #25716
Commits on Jul 6, 2023
-
feat: implement auto-cancellation of concurrent jobs
- Add a new function `CancelRunningJobs` to cancel all running jobs of a run - Update `FindRunOptions` struct to include `Ref` field and update its condition in `toConds` function - Implement auto cancellation of running jobs in the same workflow in `notify` function Signed-off-by: Bo-Yi Wu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a20c5c3 - Browse repository at this point
Copy the full SHA a20c5c3View commit details -
refactor: refactor status field to support multiple values
- Change the `Status` field in `CancelRunningJobs`, `FindRunOptions`, and `List` functions from a single `Status` to a slice of `Status`. - Update the condition in `toConds` function to check the length of `Status` slice instead of comparing a single `Status` value with `StatusUnknown`. - Modify the condition to use `builder.In` for matching multiple `Status` values instead of `builder.Eq` for a single `Status` value. Signed-off-by: Bo-Yi Wu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a1b22e2 - Browse repository at this point
Copy the full SHA a1b22e2View commit details
Commits on Jul 7, 2023
-
refactor: optimize job cancellation and action run indexing
- Add an index to the `Ref` field in the `ActionRun` struct - Modify the `CancelRunningJobs` function to use `total` instead of `len(runs)` for checking if there are no runs. Signed-off-by: Bo-Yi Wu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f066eb0 - Browse repository at this point
Copy the full SHA f066eb0View commit details -
refactor: refactor job cancellation process
- Remove the code that sets the status of a run to cancelled and updates the run in `CancelRunningJobs` function. Signed-off-by: Bo-Yi Wu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b64ed17 - Browse repository at this point
Copy the full SHA b64ed17View commit details -
Configuration menu - View commit details
-
Copy full SHA for e318f28 - Browse repository at this point
Copy the full SHA e318f28View commit details -
Configuration menu - View commit details
-
Copy full SHA for 251be01 - Browse repository at this point
Copy the full SHA 251be01View commit details
Commits on Jul 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for edeb7af - Browse repository at this point
Copy the full SHA edeb7afView commit details
Commits on Jul 12, 2023
-
Co-authored-by: Jason Song <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2db7378 - Browse repository at this point
Copy the full SHA 2db7378View commit details -
Configuration menu - View commit details
-
Copy full SHA for f383d9e - Browse repository at this point
Copy the full SHA f383d9eView commit details
Commits on Jul 13, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1b16a52 - Browse repository at this point
Copy the full SHA 1b16a52View commit details
Commits on Jul 21, 2023
-
refactor: refactor code to use
WorkflowID
instead of `WorkflowFileN……ame` - Add `WorkflowID` to the `CancelRunningJobs` function in `run.go` - Replace `WorkflowFileName` with `WorkflowID` in `FindRunOptions` struct in `run_list.go` - Update conditions in `toConds` function to use `WorkflowID` instead of `WorkflowFileName` in `run_list.go` - Replace `WorkflowFileName` with `WorkflowID` in `List` function in `actions.go` Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a7ed008 - Browse repository at this point
Copy the full SHA a7ed008View commit details -
refactor: refine job cancellation and notification logic
- Modify the comment for the `CancelRunningJobs` function to specify that it also marks unstarted jobs as cancelled - Change the comment in `notify` function to specify that running jobs are cancelled only if the event is a push - Add a condition in `notify` function to cancel running jobs of the same workflow only if the event is a push Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 18cd66f - Browse repository at this point
Copy the full SHA 18cd66fView commit details -
refactor: refactor job cancellation in workflows
- Update the `CancelRunningJobs` function to cancel all running and waiting jobs associated with a specific workflow - Modify the function parameters to include `repoID`, `ref`, and `workflowID` - Add checks and conditions to handle different job states during cancellation - Update the call to `CancelRunningJobs` in `notifier_helper.go` to match the new function signature Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 05f078d - Browse repository at this point
Copy the full SHA 05f078dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b6b17c - Browse repository at this point
Copy the full SHA 6b6b17cView commit details -
refactor: improve code readability and test robustness
- Refactor the `CancelRunningJobs` function parameters for better readability. Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 231e237 - Browse repository at this point
Copy the full SHA 231e237View commit details -
feat: implement migration to update actions ref index
- Add a new migration "Update Action Ref" to the migrations list - Create a new file `v267.go` in `models/migrations/v1_21` directory - Define a new function `UpdateActionsRefIndex` in `v267.go` to update the index of actions ref field - The `UpdateActionsRefIndex` function syncs a new instance of `ActionRun` struct which includes fields like `ID`, `Title`, `RepoID`, `OwnerID`, `WorkflowID`, `Index`, `TriggerUserID`, `Ref`, `CommitSHA`, `IsForkPullRequest`, `NeedApproval`, `ApprovedBy`, `Event`, `EventPayload`, `TriggerEvent`, `Status`, `Started`, `Stopped`, `Created`, `Updated`. Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c542d1b - Browse repository at this point
Copy the full SHA c542d1bView commit details
Commits on Jul 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for d3edc58 - Browse repository at this point
Copy the full SHA d3edc58View commit details -
refactor: refactor notifier helper and improve job handling
- Refactor the `notify` function in `notifier_helper.go` to separate the job finding and error handling steps. - Replace the `jobs` variable with `alljobs` to better reflect its purpose. - Remove the else clause and use `continue` for better readability and flow control. - Call `CreateCommitStatus` with `alljobs` instead of `jobs`. Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2412e84 - Browse repository at this point
Copy the full SHA 2412e84View commit details -
refactor: refactor status filter handling in
actions.go
- Remove the status filter from the list function in `actions.go` - Add a check for `StatusUnknown` before applying the status filter in `actions.go` Signed-off-by: appleboy <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d78596 - Browse repository at this point
Copy the full SHA 5d78596View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0ab570 - Browse repository at this point
Copy the full SHA b0ab570View commit details
Commits on Jul 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for d7b577f - Browse repository at this point
Copy the full SHA d7b577fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1af0878 - Browse repository at this point
Copy the full SHA 1af0878View commit details -
Co-authored-by: delvh <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e767742 - Browse repository at this point
Copy the full SHA e767742View commit details -
Update models/actions/run_list.go
Co-authored-by: delvh <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9ab6ec4 - Browse repository at this point
Copy the full SHA 9ab6ec4View commit details -
Update models/migrations/v1_21/v267.go
Co-authored-by: delvh <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d649e95 - Browse repository at this point
Copy the full SHA d649e95View commit details
Commits on Jul 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for face538 - Browse repository at this point
Copy the full SHA face538View commit details -
chore: update migration version and rename file
- Update migration version from `v267` to `v269` - Rename migration file from `v267.go` to `v268.go` Signed-off-by: Bo-Yi Wu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8a05c67 - Browse repository at this point
Copy the full SHA 8a05c67View commit details -
Configuration menu - View commit details
-
Copy full SHA for a79384d - Browse repository at this point
Copy the full SHA a79384dView commit details