Skip to content

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jillemash
Copy link

Fixes #30

@jillemash
Copy link
Author

Don't merge pull request for now please.

@jillemash jillemash dismissed sebastien-hertz’s stale review January 30, 2018 17:09

There's more check to be made before merging this. I already see some issues with this approach.

@jillemash
Copy link
Author

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.
Solution might be:

  • clone the repo when saving the task if it's not already present: might make the save action longer, impacting UX.
  • skip the check if not present: but leads inconsistent behavior for the user according to whether he already executed a build or not.
  • clone projects when adding the repo in the interface: that might be a better approach.

Jean-Marie Henaff added 4 commits January 31, 2018 15:55
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.
appError(req, res, '/bot/' + serviceName + ', repository of ' + repoName + ' could not be cloned');
return;
}
var fetchOut = gitForBot.fetch();

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.

Copy link
Author

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.

Copy link

@sebastien-hertz sebastien-hertz left a 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants