Closed
Bug 1354319
Opened 8 years ago
Closed 8 years ago
When I stage a commit, the bug is updated with the real commit diff from mercurial
Categories
(Conduit :: General, defect)
Conduit
General
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: davidwalsh, Unassigned)
Details
Attachments
(2 files)
Given a list of commits, the Review Service should fetch the commit patches and metadata from hg for each commit in the latest Iteration. Replaces the hard-coded diff attached to bugs.
- review_kickoff(commits_for_iteration) called from commit index topic creation
- go to hg and get metadata for each sha (the diff for each commit)
- pass that info to bmo_attachment_creator()
- mountebank mock hg endpoint holding sha info and diffs
- pytest fixture for mock hg
AC:
- POST to commit index
- print() or log() showing output of call to stub bmo_attachment_creator()
- HG communications error handling throws fatal error
| Comment hidden (mozreview-request) |
| Reporter | ||
Comment 2•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8855532 [details]
commitindex: Add real Bugzilla commit information and diffs when conduitstage is called (Bug 1354319).
https://reviewboard.mozilla.org/r/127360/#review130076
To test:
Terminal 1: `docker-compose build && docker-compose up --force-recreate`
Terminal 2:
- `docker-compose run conduitdemo /bin/sh`
- `hg clone http://hgserver/testrepo`
- `cd testrepo`, create a few commits
- `hg push`
- `hg conduitstage -r firstcommitrev:lastcommitrev http://hgserver/testrepo` (where `firstcommitrev` and `lastcommitrev` become something like "1:8")
- You should see something to the effect of: `Successfully made Iteration id=1 on Topic id=1 with commits: [fc232e2fb5e58c98ecb9952f840de850efa0fdc9, f0bf2469c25b60f324031ade48633a8b1801b023, f243049276ca3d163c8116a1eff0c4501deefa13]`
- Open Bugzilla in your browser: http://(youripaddres):7777
- Navigate to /show_bug.cgi?id=1
- Scroll down to the "attachments" table and verify the commits are in the right order, their diffs are correct
::: commitindex/commitindex/reviews/triggers.py:34
(Diff revision 1)
> + 'Request for commit metadata failed: %s' % rev_set
> + )
> +
> + # Reversing the list because they are provided in desc order
> + commits_meta = metadata_json['entries']
> + commits_meta.reverse()
I tried `metadata_json['entries'].reverse()` and `list(metadata_json['entries']).reverse()` and both gave me errors; for some reason I needed to do a `reverse` by itself :/
::: staginghgserver/docker/hgweb.conf:12
(Diff revision 1)
>
> [extensions]
> conduit = /hgext/conduit.py
> +
> +[phases]
> +publish = false
Ensures hgserver is non-publishing.
| Reporter | ||
Comment 3•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8855532 [details]
commitindex: Add real Bugzilla commit information and diffs when conduitstage is called (Bug 1354319).
https://reviewboard.mozilla.org/r/127360/#review130078
This is incomplete, as I still need to add tests, but any advice/review is welcome.
| Reporter | ||
Comment 4•8 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8855532 [details]
commitindex: Add real Bugzilla commit information and diffs when conduitstage is called (Bug 1354319).
https://reviewboard.mozilla.org/r/127360/#review130076
Sorry, the first step under "Terminal 2" should be `docker-compose run conduitdemo /bin/sh`
| Reporter | ||
Comment 5•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8855532 [details]
commitindex: Add real Bugzilla commit information and diffs when conduitstage is called (Bug 1354319).
https://reviewboard.mozilla.org/r/127360/#review130448
::: commitindex/commitindex/reviews/triggers.py:23
(Diff revision 1)
>
> + # Assumes only a single path, merge commits would have been
> + # weeded out by this point
> + rev_set = '%s::%s' % (commit_ids[0], commit_ids[-1])
> + commits_meta_request = requests.get(
> + 'http://hgserver/testrepo/json-changelog/?rev=%s' % rev_set
How should we deal with this hgserver address? A constant? An environment var? A settings file?
| Comment hidden (mozreview-request) |
Comment 7•8 years ago
|
||
Outdated, no longer needed - there is no commitindex yet in the new commit pipeline architecture.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•