This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: automatically listing fixed bugs for NEWS


On Thursday 29 October 2015 10:27 PM, Joseph Myers wrote:
> Attached is a (Python 3) script to generate a list of fixed bugs for NEWS 
> from Bugzilla data (including bug summaries as proposed by Mike in 
> <https://sourceware.org/ml/libc-alpha/2015-08/msg00103.html>), using the 
> Bugzilla API to obtain the relevant information from Bugzilla in JSON 
> format.  I've included current output below.  Note that this output is 
> *not* complete, as I haven't finished going through bugs listed in NEWS 
> for 2.23 to set their milestones; that would be necessary before switching 
> from manual NEWS updates to using this script.
> 
> What do people think of using this script - put in 
> scripts/list-fixed-bugs.py, say - to replace the manual NEWS edits when 
> fixing bugs?

If we plan to have additional scripts that are run only for releases and
are not part of the build process, it might be a good idea to keep them
in a separate 'release' or 'releng' directory.  That'll help us keep
simple constraints in place like ensuring that none of the build scripts
are python since that will create an additional dependency.

> * We previously discussed having a "fixed in" Bugzilla field to handle 
> bugs fixed on both mainline and release branches.  But since we don't 
> currently make point releases (just leaving it to distributors to get 
> release branch changes from git), that seems pretty pointless - the script 
> would never be run for release branches.  So for now I'd proposed that 
> people continue to edit NEWS manually for release branch fixes (using the 
> new longer format, of course).

Agreed.

> * It would become important that people do actually set milestones when 
> closing bugs as fixed.  Thus, people watching commits and Bugzilla should 
> watch for that.

I wonder if bugzilla has some hidden field that stores the next release
number so that if it is closed without a set milestone, it defaults to
the next one.  It then becomes the responsibility of the release manager
to bump that bugzilla value on release.

> * I'd be inclined to put the list of fixed bugs at the *end* of the NEWS 
> section for a release, rather than at the start, so starting with the more 
> significant changes with their own NEWS items.

Agreed.

> list-fixed-bugs.py

Could you confirm if the script comes clean through scripts/pylint?
FWIW, that ought to go into that separate release directory too.

> #! /usr/bin/python3
> # Copyright (C) 2015 Free Software Foundation, Inc.
> # This file is part of the GNU C Library.
> #
> # The GNU C Library is free software; you can redistribute it and/or
> # modify it under the terms of the GNU Lesser General Public
> # License as published by the Free Software Foundation; either
> # version 2.1 of the License, or (at your option) any later version.
> #
> # The GNU C Library is distributed in the hope that it will be useful,
> # but WITHOUT ANY WARRANTY; without even the implied warranty of
> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> # Lesser General Public License for more details.
> #
> # You should have received a copy of the GNU Lesser General Public
> # License along with the GNU C Library; if not, see
> # <http://www.gnu.org/licenses/>.
> 
> """List fixed bugs for the NEWS file.
> 
> This script takes a version number as input and generates a list of
> bugs marked as FIXED with that milestone, to be added to the NEWS file
> just before release.  Run the script in a UTF-8 locale.
> """
> 
> import json
> import sys
> import textwrap
> import urllib.request
> 
> def list_fixed_bugs(version):
>     """List the bugs fixed in a given version."""

The PEP8 format (that is what I remember we had agreed on for the
benchtests script) requires you to describe each parameter as well IIRC.

>     url = ('https://sourceware.org/bugzilla/rest.cgi/bug?product=glibc'
>            '&resolution=FIXED&target_milestone=%s'
>            '&include_fields=id,summary' % version)
>     response = urllib.request.urlopen(url)
>     json_data = response.read().decode('utf-8')
>     data = json.loads(json_data)
>     for bug in data['bugs']:
>         desc = '[BZ #%d] %s' % (bug['id'], bug['summary'])
>         desc = textwrap.fill(desc, width=76, initial_indent='  ',
>                              subsequent_indent='    ')
>         print(desc)
> 
> if __name__ == '__main__':
>     list_fixed_bugs(sys.argv[1])
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]