Merge Request #75

Merged
softwarepublico/colab!75
Created by Gustavo Jaruga Cruz

Fix gitlab links

This MR should be merged to release-3.0 too. Fix gitlab hyperlinks for merge_requests and issues.

Assignee: None

Merged by Sergio Oliveira

Source branch has been removed
Commits (2)
3 participants
    9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
    Sergio Oliveira started a discussion on the diff
    last updated by Sergio Oliveira
    colab/plugins/gitlab/models.py
    27 27 class GitlabMergeRequest(Collaboration):
    28 28  
    29 29 id = models.IntegerField(primary_key=True)
      30 + iid = models.IntegerField(null=True)
    4
    • 9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
      Sergio Oliveira @seocam (Edited )

      What does this second "i" stands for? Can't it be merge_request_id or mr_id?

      Choose File ...   File name...
      Cancel
    • C6b14af78e51fba6beb90142971240cc?s=40&d=identicon
      Gustavo Jaruga Cruz @darksshades

      I stands for the id inside a project. The 'id' is the unique identifier white the 'iid' is the id counter inside a project.

      Choose File ...   File name...
      Cancel
    • C6b14af78e51fba6beb90142971240cc?s=40&d=identicon
      Gustavo Jaruga Cruz @darksshades

      We use 'iid' to follow gitlab_api rules, doing that, the json parser automatically parser the values without any aditional 'if's in the code

      Choose File ...   File name...
      Cancel
    • 9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
      Sergio Oliveira @seocam

      Ok.

    9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
    Sergio Oliveira started a discussion on the outdated diff
    last updated by Gustavo Jaruga Cruz
    colab/plugins/gitlab/models.py
    133 135 def url(self):
    134 136 if self.issue_comment:
    135 137 return u'/gitlab/{}/issues/{}#notes_{}'.format(
    136   - self.project.path_with_namespace, self.parent_id, self.id)
      138 + self.project.path_with_namespace, self.parent_id, self.iid)
    2
    • 9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
      Sergio Oliveira @seocam

      Note that both parts of the conditional are pretty much the same. It would be better refactor to keep only the template string and format just once afterward.

      Choose File ...   File name...
      Cancel
    • C6b14af78e51fba6beb90142971240cc?s=40&d=identicon
      Gustavo Jaruga Cruz @darksshades

      Makes sense, commited on new commit.

      Choose File ...   File name...
      Cancel
  • C6b14af78e51fba6beb90142971240cc?s=40&d=identicon
    Gustavo Jaruga Cruz @darksshades

    Added 1 new commit:

    • 9a166399 - Refactor url method of mr/issue
    Choose File ...   File name...
    Cancel
  • F1c4e7359f83d87a9b8ffc5a003e9cc9?s=40&d=identicon
    Alexandre Barbosa @alexandre

    Milestone changed to Link errado nas colaborações(MR)

    Choose File ...   File name...
    Cancel
  • 9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
    Sergio Oliveira @seocam
    Choose File ...   File name...
    Cancel