Skip to content
Snippets Groups Projects

Redmine Mailbot: Support the case where there are multiple Redmine IDs

Open Yoann Schneider requested to merge support-multiple-redmine into master
3 unresolved threads

This case happened because IDRIS support also uses Redmine and leaves the ID of the issue in the subject. The current version would match that ID instead of ours.

[idris.fr #117392] Librairie slurm inaccessible sur Jeanzay [#8683]

I also found an unused regex.

Merge request reports

Pipeline #191343 passed

Pipeline passed for 820a2a24 on support-multiple-redmine

Approval is optional

Set by to be merged automatically when the pipeline succeeds

Ready to merge by members who can write to the target branch.

Merge details

  • The source branch is 5 commits behind the target branch.
  • 1 commit and 1 merge commit will be added to .
  • Source branch will not be deleted.
  • Auto-merge enabled

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
17 17
18 18 Contact = redminelib.resources.Contact if REDMINE_PRO_EDITION else Any
19 19
20 REDMINE_ISSUE_ID_PATTERN = re.compile(r"#\d+")
21 REDMINE_TICKET_ID_PATTERN = re.compile(r"\d+")
20 # Look for last issue ID.
21 # It should be at the very end of the subject
22 REDMINE_ISSUE_ID_PATTERN = re.compile(r"\[(#\d+)\]$")
  • There is no rule about this. Some mails have [Prospect #xxxx] (see here and here) and the ID [#xxxx] is at the end only because CK and you use it like this, but someone new can use it at the beginning.

  • Please register or sign in to reply
  • 17 17
    18 18 Contact = redminelib.resources.Contact if REDMINE_PRO_EDITION else Any
    19 19
    20 REDMINE_ISSUE_ID_PATTERN = re.compile(r"#\d+")
    21 REDMINE_TICKET_ID_PATTERN = re.compile(r"\d+")
  • 148 149 # Try to update an existing issue
    149 150 issue = next(
    150 151 map(partial(self.update_issue, mail=mail, uploads=uploads), issue_ids), None
    151 152 )
    • Comment on lines 149 to 151

      This code should find all IDs (so #117392 and #8683 in your case) and try to find the first valid issue. It should therefore have found issue #8683. Wasn't it because of a lack of rights to the project that the email wasn't added?

      Edited by Manon Blanco
    • Please register or sign in to reply
  • Manon Blanco removed review request for @mblanco

    removed review request for @mblanco

  • Please register or sign in to reply
    Loading