Opened 8 years ago

Closed 3 years ago

#1751 enhancement closed fixed (fixed)

Make macro or plugin or something so project pages automatically display latest releases

Reported by: itamarst Owned by: exarkun
Priority: normal Milestone: totally automated release infrastructure
Component: website Keywords:
Cc: thijs, exarkun, radix Branch:
Author: Launchpad Bug:

Description


Change History (19)

comment:1 Changed 7 years ago by exarkun

  • Owner changed from exarkun to radix

I guess this would be cool. It seems release-managementy though. Let me know if there's something I can do to help with this.

comment:2 Changed 5 years ago by thijs

  • Cc thijs added
  • Owner changed from radix to thijs
  • Status changed from new to assigned

What does 'displaying the latest releases' mean here?

comment:3 Changed 5 years ago by thijs

  • Keywords review added

I'll fix this up but need feedback on my previous ticket, what does this plugin need to do exactly?

comment:4 Changed 5 years ago by thijs

  • Owner thijs deleted
  • Status changed from assigned to new

comment:5 follow-up: Changed 5 years ago by exarkun

  • Cc exarkun added
  • Keywords review removed
  • Owner set to thijs

Hm. I think the subproject pages, eg TwistedWords, used to link directly to subproject release tarballs. They don't appear to any longer. This is probably for the best.

So as far as I know, this means that we don't even have to update all the subproject pages when we do a new release.

We just have to update the download box on the front page and the Downloads page. That still means a lot of things to update. So if we could have those links/that wiki markup/whatever automatically generated based on some structured information that a tool (run as part of the release process) can easily update, that'd be pretty neat.

So:

  1. Represent the current releases in a structured way
  2. Have a tool for updating that structured data
  3. Have a trac plugin that can read that structure and emit some kind of markup in the places I mentioned above. (Alternatively, don't do this as a trac plugin, and find some other way to get the content into place; I'm all for avoiding touching trac or trac code, but it's not totally obvious how we could do this without getting into trac... an iframe? some javascript? ooohh yea javascript I love it)

comment:6 Changed 5 years ago by thijs

  • Cc radix added

comment:7 Changed 5 years ago by thijs

  • Milestone set to regular-releases

comment:8 in reply to: ↑ 5 Changed 4 years ago by thijs

  • Keywords review added
  • Owner changed from thijs to exarkun

Replying to exarkun:

We just have to update the download box on the front page and the Downloads page. That still means a lot of things to update. So if we could have those links/that wiki markup/whatever automatically generated based on some structured information that a tool (run as part of the release process) can easily update, that'd be pretty neat.

I'm not able to edit the front page, is this a custom HTML page?

I created a wiki macro that knows about a project version, that could be used to keep the Downloads page (and others) up to date. Here's some documentation:

Macro that returns the Twisted version.

Standalone

[[ProjectVersion]]

produces:

9.0.0

URL

[[ProjectVersion(http://tmrc.mit.edu/mirror/twisted/Twisted/%s/Twisted-%s.win32-py2.6.msi Twisted %s for Python 2.6)]]

produces:

Twisted 9.0.0 for Python 2.6

Source browser

[[ProjectVersion(source:/tags/releases/twisted-%s/ SVN)]]

produces:

[source:/tags/releases/twisted-9.0.0/ SVN]

comment:9 Changed 4 years ago by thijs

Another question: where do we want to pull the twisted version number from? Store it in the conf/trac.ini file in a Twisted section or something?

[twisted]
version = 10.0.0

Currently the macro pulls it from the local Twisted installation.

comment:10 Changed 4 years ago by exarkun

  • Owner exarkun deleted

comment:11 follow-up: Changed 4 years ago by glyph

The link to "Wiki Macro" just says "Internal Server Error" when I hit it.

What is the expected outcome of this ticket review, by the way? Is it just to be merged to the trac integration branch, or should it only be reviewed as OK once all of the wiki pages have also been updated? is there a separate ticket for that?

I'd rather the version number be stored somewhere actually editable via the wiki, but a config file is better than nothing, I suppose...

comment:12 Changed 4 years ago by glyph

  • Keywords review removed
  • Owner set to thijs

Removing from the review queue until somebody answers that question.

comment:13 in reply to: ↑ 11 Changed 4 years ago by thijs

Replying to glyph:

The link to "Wiki Macro" just says "Internal Server Error" when I hit it.

Weird, I get the same error. This link should work hopefully:

http://bazaar.launchpad.net/~collab/twisted-trac-integration/trac-plugin/annotate/head:/trac/plugins/twisted-trac/twisted_trac/macro.py

comment:14 Changed 4 years ago by thijs

  • Status changed from new to assigned

comment:15 Changed 4 years ago by <automation>

  • Owner thijs deleted

comment:16 Changed 4 years ago by exarkun

  • Owner set to thijs
  • Status changed from assigned to new

Hi thijs,

Thanks for working on this. I didn't realize how much you'd done in your trac-plugin branch.

I would like to deal with just the version macro feature sometime soon. I struggled for a while to get just the macro from your branch working, without the rest of the features, but I wasn't able to. Can you split this out into a plugin that provides only the macro?

Thanks.

comment:17 Changed 3 years ago by thijs

  • Status changed from new to assigned

comment:18 Changed 3 years ago by thijs

  • Keywords review added
  • Owner changed from thijs to exarkun
  • Status changed from assigned to new

Download the macro.py file and simply put it in the plugins sub-folder of the trac environment.

With a test project:

$ trac-admin --version
trac-admin 0.12.3dev-r10792
$ trac-admin twisted-trac initenv
Creating a new Trac environment at /home/thijs/workspaces/opensource/twisted-trac
...
$ trac-admin twisted-trac permission add admin TRAC_ADMIN
$ cp ~/Downloads/macro.py twisted-trac/plugins/
$ tracd --auto-reload --single-env --port=8000 --basic-auth="twisted-trac,/home/thijs/workspaces/opensource/.htpasswd,twisted" twisted-trac

Now edit a wiki page and insert:

[[ProjectVersion(http://tmrc.mit.edu/mirror/twisted/Twisted/%s/Twisted-%s.win32-py2.6.msi Twisted %s for Python 2.6)]]

[[ProjectVersion]]

comment:19 Changed 3 years ago by exarkun

  • Keywords review removed
  • Resolution set to fixed
  • Status changed from new to closed

Thanks.

I had to hack on this a bit more:

  1. %s wasn't sufficient. Many download links have a 9.0 component rather than a 9.0.0 component (intentionally, to keep point releases closer together, I suppose). I expanded this to %(major)s, %(minor)s, %(micro)s, and %(base)s. This involved a gross url unquoting hack.
  2. For some reason the output was multiline. I switched to OneLinerFormatter to fix this.
  3. I didn't want to peg the output of the macro to the version of Twisted running the trac server, so I had it read the version from the latest md5sums filename instead. This isn't ideal, but it'll work for a while I guess.

I am checking the result in to twisted-trac-integration. It is deployed on the site right now, and I've updated the Downloads page to use it.

Thanks!

Note: See TracTickets for help on using tickets.