Opened 4 years ago

Closed 4 years ago

Last modified 2 weeks ago

#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

Change History (13)

comment:1 Changed 4 years ago 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 4 years ago by fhd

  • Description modified (diff)

comment:3 Changed 4 years ago 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 4 years ago by fhd

  • Description modified (diff)

comment:5 Changed 4 years ago by fhd

  • Description modified (diff)

comment:6 Changed 4 years ago 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 4 years ago by fhd

  • Blocking 3676 added

comment:8 Changed 4 years ago by fhd

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

comment:9 Changed 4 years ago by fhd

  • Blocking 3679 added

comment:10 Changed 4 years ago by fhd

  • Blocking 3681 added

comment:11 Changed 4 years ago by fhd

  • Description modified (diff)

comment:12 Changed 4 years ago by fhd

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

comment:13 Changed 6 months ago by samsun3622

spam

Last edited 2 weeks ago by kzar (previous) (diff)
Note: See TracTickets for help on using tickets.