mantisbt-plugins / source-integration

Source control integration plugin framework for MantisBT, including support for Github, Gitlab, Bitbucket, Gitea, Gitweb, Cgit, Subversion, Mercurial and more
http://noswap.com/projects/source-integration/
MIT License
181 stars 130 forks source link

Branches in branch mappings cannot contain a '/' #230

Open Nick-Hall opened 7 years ago

Nick-Hall commented 7 years ago

When I click "Update Mappings" with a branch set to "maintenance/gramps50" it changes to "gramps50".

dregad commented 7 years ago

Which VCS plugin is this with ?

dregad commented 7 years ago

Nevermind, I just saw you mentioned this in #229

dregad commented 7 years ago

I'm not able to reproduce this. screenshot-20170616-1202

Which version of SI plugin are you using ?

Nick-Hall commented 7 years ago

We are using Source Control Integration 2.0.3 and Source GitHub Integration 2.0.0.

Nick-Hall commented 7 years ago

I found the problem. The branch name cannot be modified. I created a mapping with "gramps50" by mistake, and then tried to change it to "maintenance/gramps50".

The solution was to delete the mapping and create a new one.

dregad commented 7 years ago

The branch name cannot be modified

Thanks for the feedback. I never realized that until today... And in fact I'm not sure it can be fixed easily as the table uses repo_id + branch name as primary key, and not an arbitrary ID field.

To avoid future confusion, the simplest would be to make the field read-only.

I'll also check if it's feasible to modify the code to allow updating the branch name, but that might require a schema change.

dregad commented 7 years ago

To avoid future confusion, the simplest would be to make the field read-only.

243 has been opened to track this as a workaround

This issue remains open to track the better fix, which would require adding a primary key to the branch table.