-
Notifications
You must be signed in to change notification settings - Fork 23
Check branch exists when editing a task #31
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
base: main
Are you sure you want to change the base?
Conversation
Don't merge pull request for now please. |
There's more check to be made before merging this. I already see some issues with this approach.
This does not work as it requires a repo to have been previously cloned, which is not yet the case before any task has been executed.
|
This way, checks on task form entries concerning branch or commit id can work.
Also make clone() return output of command, so error can be checked by caller.
dana-bot/src/www.js
Outdated
appError(req, res, '/bot/' + serviceName + ', repository of ' + repoName + ' could not be cloned'); | ||
return; | ||
} | ||
var fetchOut = gitForBot.fetch(); |
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.
IMO the fetch part should be in the else clause of the if. I mean you only need to 'git fetch' if the repo already exists (and you want to update remote info), otherwise you'd do the 'git clone' which would give an up-to-date repo.
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.
I agree, although the fetch part should take no time if the repo just got cloned, it makes more sense that way. Done in upcoming commit.
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.
It seems to me that we should do either a 'git clone' or a 'git fetch' but not both. WDYT?
Fixes #30