Opened on 02/21/2016 at 11:04:14 AM

Closed on 02/24/2016 at 08:32:41 PM

Last modified on 10/08/2019 at 05:45:39 PM

#3674 closed change (fixed)

Add a hg hook that references commits in issues

Reported by: fhd Assignee: fhd
Priority: P4 Milestone:
Module: Sitescripts Keywords:
Cc: Blocked By:
Blocking: #3676, #3679, #3681 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29336790

Description (last modified by fhd)

Background

Whenever we currently commit something linked to a specific issue, we manually add a comment pointing to that commit. That's fairly easy to automate, since commit messages always have the same format.

We can extend this further in the future:

  • We could reject commits that don't specify either an issue or Noissue in the canonical format. (#3679)
  • We could automatically close issues once they've been mentioned in a commit. (#3681)

What to change

Write a changegroup hook that inspects the changeset descriptions (i.e. commit messages) and checks if an issue was referenced. The canonical format for that is: Issue [number] - [message].

If an issue was referenced, the hook should post a comment to the respective issue, posting the changeset URL. The message should be the following if a single commit referencing an issue was found:

A commit referencing this issue has landed:
CHANGESET_URL

And the following if multiple commits referencing an issue were found:

Some commits referencing this issue have landed:

  • CHANGESET_URL_1
  • CHANGESET_URL_2

Attachments (0)

Change History (13)

comment:1 Changed on 02/21/2016 at 11:06:40 AM by fhd

  • Component changed from Sitescripts to Infrastructure

Will probably end up in infrastructure rather than sitescripts because an internal hook makes more sense. But the jury is still out I suppose.

comment:2 Changed on 02/21/2016 at 11:08:47 AM by fhd

  • Description modified (diff)

comment:3 Changed on 02/21/2016 at 01:52:35 PM by fhd

  • Component changed from Infrastructure to Sitescripts
  • Description modified (diff)

Silly me, internal hooks are just modules somewhere on the PYTHONPATH, sitescripts it is.

Also updating the description a bit, I want to keep it simple for now.

comment:4 Changed on 02/21/2016 at 01:53:33 PM by fhd

  • Description modified (diff)

comment:5 Changed on 02/21/2016 at 01:58:48 PM by fhd

  • Description modified (diff)

comment:6 Changed on 02/22/2016 at 10:52:46 AM by fhd

  • Summary changed from Write a hg hook that adds a comment on the relevant issue for each commit to Add a hg hook that references commits in issues

comment:7 Changed on 02/22/2016 at 10:59:37 AM by fhd

  • Blocking 3676 added

comment:8 Changed on 02/22/2016 at 11:02:19 AM by fhd

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:9 Changed on 02/22/2016 at 07:39:36 PM by fhd

  • Blocking 3679 added

comment:10 Changed on 02/22/2016 at 07:59:28 PM by fhd

  • Blocking 3681 added

comment:11 Changed on 02/22/2016 at 08:00:24 PM by fhd

  • Description modified (diff)

comment:12 Changed on 02/24/2016 at 08:32:41 PM by fhd

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:13 Changed on 04/18/2019 at 07:02:52 AM by samsun3622

spam

Last edited on 10/08/2019 at 05:45:39 PM by kzar

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from fhd.
 
Note: See TracTickets for help on using tickets.