We lower case all the ScmUrl a while ago: https://github.com/screwdriver-cd/screwdriver/pull/61
It's giving us problem. The github API actually makes a distinction between lower and upper case:
https://api.github.com/repos/screwdriver-cd/models/branches/newformat gives nothing
https://api.github.com/repos/screwdriver-cd/models/branches/NewFormat gives the branch
GitHub says repository names are case sensitive.
https://help.github.com/articles/error-repository-not-found/
But we can still clone the repository with case insensitive name.
I think branch names that we specify in GitHub API are case sensitive due to restriction of git.
Git uses a file or a directory for branches, so the branch and the tag names are case sensitive.
If those are correct, Screwdriver should generate pipelineId from lowercased repository name and raw branch name.
It's interesting that repo names are supposed to be case sensitive, but it still allows cloning insensitively. I like the change you made and that should fix this.
Should be resolved now that @catto's PR is merged. We can verify on Monday.
Hmm so should it be possible to create different pipelines for [email protected]:screwdriver-cd/models.git#master and [email protected]:screwdriver-cd/models.git#MASter?
No. So it's tricky. When creating a branch, it's case insensitive. Like if NewFormat already exists, then you can't create newformat. When getting a branch, it's case sensitive. Like:
https://api.github.com/repos/screwdriver-cd/models/branches/newformat gives nothing
https://api.github.com/repos/screwdriver-cd/models/branches/NewFormat gives the branch
So we need to figure out something for the conflict error.
@d2lam that's because you're on a mac. On linux, those are two different branches.
Really? that's so weird. But that's good for us.
$ git branch
* master
$ git checkout -b mASter
Switched to a new branch 'mASter'
https://twitter.com/tmoitie/status/420608135653769217 for OSX :)
Nice!
@d2lam In that case, is this issue resolved?
@catto's fix was merged but we haven't verified yet.
Technically it's verified. But there's a new bug with that we don't verify the branch exists.
When a new pipeline is created, the scmUrl is formatted correctly. That part of the issue is still solved.
When a webhook is received, we don't convert the scmUrl in the payload. This is causing some of our functional test runs to fail due to the webhooks not being able to communicate with the API.
Doesn't matter anymore.
Most helpful comment
https://twitter.com/tmoitie/status/420608135653769217 for OSX :)