Skip to content

Conversation

Omicron7
Copy link
Contributor

@Omicron7 Omicron7 commented Aug 13, 2024

This adds an API option when running a Task to allow overriding the Git Branch used/cloned during the Task execution. It also add the ability to override the Git Branch used by a Template when created with the API. This is useful for running Tasks using a development, or specific release branch of a repository.

Implements #2277

@fiftin
Copy link
Collaborator

fiftin commented Aug 18, 2024

let's allow null value for this column.

Null value more efficient for heavily used columns in large tables.

@Omicron7
Copy link
Contributor Author

@fiftin Updated to remove the not null constraint. I originally just copied the column from the project__repository table.

@fiftin
Copy link
Collaborator

fiftin commented Aug 22, 2024

Hi @Omicron7 thank you!

I think we should add ability to choose branch in template too. Not just in task. It will be logically.

@Omicron7
Copy link
Contributor Author

@fiftin I've rebased on the latest develop and added the ability to override git_branch on a Project Template using the API. LocalJob will preference git_branch on the Task over the Template if both are set.

I'll need you to implement, or help if you'd like git_branch exposed on the front end for a Template.

@Omicron7
Copy link
Contributor Author

dredd tests are passing locally for me using boltdb. Not sure why they are failing in GitHub Actions.

2024-09-17T15:48:55.213Z - debug: Gracefully terminating the hooks handler process
2024-09-17T15:48:55.213Z - debug: Wrapping up testing and waiting until all reporters are done
complete: 76 passing, 0 failing, 0 errors, 16 skipped, 92 total
complete: Tests took 8509ms

@Omicron7
Copy link
Contributor Author

@fiftin This should be good to go. I realized the git_branch wasn't actually saving to the database, so I fixed that and as well as allowing null.

@Omicron7 Omicron7 changed the title Allow override of Task git_branch Allow override of Task and Template git_branch Sep 18, 2024
@Omicron7 Omicron7 force-pushed the override-git-branch branch from 2878130 to c1875eb Compare October 1, 2024 19:14
@Omicron7 Omicron7 force-pushed the override-git-branch branch from c1875eb to 792d42b Compare October 7, 2024 14:04
@Omicron7
Copy link
Contributor Author

Omicron7 commented Oct 7, 2024

@fiftin I've rebased this on the latest develop and fixed the merge conflicts. Would it be possible to get this is the next release?

@Omicron7
Copy link
Contributor Author

Omicron7 commented Oct 7, 2024

I am unsure how to fix the Codacy issues.

@fiftin
Copy link
Collaborator

fiftin commented Oct 18, 2024

Hi @Omicron7 sorry for delay,

Codacy is not a problem. I reviewing your PR. Thank you.

@fiftin fiftin merged commit 4e6b8d0 into semaphoreui:develop Oct 19, 2024
13 checks passed
@fiftin
Copy link
Collaborator

fiftin commented Oct 19, 2024

Thank you Brian!
merged

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.

2 participants