Ticket #76 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 6 months ago

add mercurial RSS poller change source

Reported by: TedMielczarek Owned by: warner
Priority: major Milestone: 0.8.+
Version: 0.7.5 Keywords: hg
Cc: Pike, durin42@…, in3xes@…

Description

To use a Mercurial repo as a change source, you currently have to install a hook script in the repo. I've written a change source that polls the RSS feed available in the Hg web interface.

Attachments

buildbot-hgpoller.patch Download (4.2 KB) - added by TedMielczarek 5 years ago.
hgpoller.py (unified diff)
hgpoll.diff Download (896 bytes) - added by bhearsum 4 years ago.
fix traceback when change_list is empty
hgPoller-pushlog-v2.diff Download (9.2 KB) - added by bhearsum 4 years ago.
hgpoller using pushlog

Change History

Changed 5 years ago by TedMielczarek

hgpoller.py (unified diff)

comment:1 Changed 5 years ago by Pike

  • Cc Pike added

r- from me, urllib.urlopen is evil, as it hangs the buildmaster if the server is slow or down. Use twisted.web.client.getPage instead. I have an example patch in #76, though I need to find out why it has test failures. The other comment I have is that you should pick the revision from the RSS and set it in the changeset. I wonder if there's a halfway cheap way to get the files for that revision from hg, any idea?

comment:2 Changed 5 years ago by Pike

duh, #61 that is

comment:3 Changed 5 years ago by TedMielczarek

Alright, I can replace urllib.urlopen. I'm not sure what you mean about getting the revision from the RSS, as Mercurial only supports changeset IDs (that I know of), see view-source:http://hg.mozilla.org/mozilla-central/?rss-log

comment:4 Changed 5 years ago by Pike

As discussed on #developers, the changeset ID, that is, the numbers like d7e93861f3f3 uniquely identify a snapshot of the repository and thus make a good revision to give to the changeset.

Getting the list of files likely requires modifications to hg, which Ted may or may not do at some point in time or another. Or so. Vague enough? ;-)

comment:5 Changed 4 years ago by Pike

I was wondering, would we end up with a repository on the master anyway? If so, it might be more powerful to just pull (and update?) and to get the changes from the local rep directly.

comment:6 Changed 4 years ago by warner

  • Milestone changed from undecided to 0.7.7

comment:7 Changed 4 years ago by warner

  • Milestone changed from 0.7.7 to 0.7.8

no progress on this yet, bumping to 0.7.8

Changed 4 years ago by bhearsum

fix traceback when change_list is empty

comment:8 Changed 4 years ago by bhearsum

  • Cc bhearsum@… added

comment:9 Changed 4 years ago by bhearsum

I'm working on a different version of this, that works in conjunction with the pushlog extension ( http://hg.mozilla.org/users/bsmedberg_mozilla.com/hgpoller/index.cgi/file/76f6d3a9078a/pushlog-feed.py). This works much much better with huge pushes/merges. I'm not sure if this will be as useful to others (since it relies on an external extension). I'll post it here when I'm done and let others decide.

Changed 4 years ago by bhearsum

hgpoller using pushlog

comment:10 Changed 4 years ago by bhearsum

Here's the version we're using now. It requires the 'pushlog' hgweb extension that I mentioned in my last comment. I'm not sure how useful this makes it for others, but I wanted to post it nonetheless.

comment:11 Changed 4 years ago by Pike

I frown upon urlopen. Can you use twisted's getPage for the actual loading of the feed so that it's asynch? Like we do in bonsaipoller now, http://buildbot.net/trac/browser/buildbot/changes/bonsaipoller.py#L299.

In _parse_changes, I'd do the check for updated first thing, and continue in the loop. Mozilla early-return style, maybe. I'd be tempted to play with a generator function instead of the for loop, too.

In _process_changes, we got the changes in chronological order, didn't we? I see you doing the max over all changes, instead of just the last?

I read that pushlog has the files in the output, we're not reading those in?

comment:12 Changed 3 years ago by Pike

Note, none of the attached versions are still in use on our setups.

comment:13 Changed 3 years ago by dustin

  • Milestone changed from 0.8.0 to 0.7.+

I'm with Pike re: using getPage. Once that is fixed, and there are docs and tests, this is good to go.

comment:14 Changed 3 years ago by bhearsum

I might have time to fix this up in the next month. No promises, though.

comment:15 Changed 3 years ago by bhearsum

  • Cc bhearsum@… removed

comment:16 Changed 3 years ago by durin42

  • Cc durin42@… added

comment:17 Changed 21 months ago by dustin

  • Keywords hg added

comment:18 Changed 8 months ago by in3xes

  • Cc in3xes@… added

comment:19 Changed 8 months ago by dustin

Ted, ben, any chance this is still going to happen, or should we close this as wontfix?

comment:20 Changed 6 months ago by TedMielczarek

I don't think we're actually using this code anymore, so we can probably wontfix it.

comment:21 Changed 6 months ago by dustin

  • Status changed from new to closed
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.