48 Commits

Author SHA1 Message Date
Doug Hellmann
f446ef37f4 generate the series status table from data
Move the information about the series status into a data file and use
that to generate the table on the main page. This is the first step
toward adding deliverable-specific series status information to the
output, since we need a place to put the default values.

Because we're adding a yaml file under the deliverables directory that
is not actually a deliverable file, we have to update the validation
tool to ignore it.

Story: #2001852
Task: #14347
Change-Id: I99bd94a323b53c0dfc2cb648268e51a30321cd46
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-20 14:05:04 -04:00
Doug Hellmann
40a3e39d38 be consistent with use of log levels and print
Change-Id: I0bd5b6f871cc59e6fb5f29da9daa175524541132
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-07 10:49:49 -05:00
Doug Hellmann
98eb82f891 move error and warning message collection into a class
Change-Id: I086ff2a6ddb31dcb611f4655a5cf3415281ca5c0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-06 10:23:12 -05:00
Doug Hellmann
bfd96f4fc0 wrap subprocess to capture output in tests
Provide some wrappers around subprocess functions to capture stderr
and stdout and divert it to the logs so that the test output is less
cluttered with the output of various git commands.

Change-Id: If36ef013aca498e3a0a9cc3a2b78d666775439ab
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-02-08 05:14:13 -06:00
Doug Hellmann
6ac14737b7 report warnings when the supported versions of dependencies change
Compute the dependency set for the python code being released and
report when the old minimum version no longer falls within the
specified range. For releases from master treat the message as an
error. For other branches treat the message as a warning.

Update clone_repo() to return the location where the clone was written
as a convenience to the caller.

Extract the logic for determining if a version is using
pre-versioning (alpha, beta, etc.) so it can be reused.

Change-Id: I22a2f6df7f3502e4fcbf2d61ef5fee849ab15529
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-11-29 16:30:24 -05:00
Doug Hellmann
fece255a3c look for patches on origin/master or master
When the branch for the series does not exist, look on 'origin/master'
as well as 'master' because depending on how the repo is cloned we
might not have a branch called 'master'.

Change-Id: I6abc0b0b3a1657211a01b80547602bbbe83f065e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-11-15 17:51:25 -05:00
Doug Hellmann
77e0060f62 enable logging in validate command
Turn on logging output, to the console, and add some log statements in
gitutils.

Change-Id: I63c80c9b2d6674d64dbc8b341a36ad51248aa19c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-11-15 17:51:25 -05:00
Doug Hellmann
1a8ea6a06d add safe_clone_repo function
We have logic for dealing with cloning errors repeated in several
places. This patch combines it into one function that can be called
more easily without having to trap exceptions.

Change-Id: Ib5f6c3f801481b28513ce8fab0f5624c02e60d97
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-11-13 12:16:39 -05:00
Doug Hellmann
34756ddbdf replace the use of zuul-cloner with a shell script
Under zuulv3 the behavior has changed significantly to now require
specifying which repositories need to be cloned for each job, and
zuul-cloner only copies the repositories that are already
available. As soon as zuulv3 is released, our jobs relying on the old
fallback behavior of checking out from a cache when present but using
the upstream server in other situations will fail.

The new script tools/clone_repo.sh handles the cases we have in the
tools and jobs within this repository, and should also be usable from
the tag-releases job.

zuul is removed from the list of requirements so it is no longer
installed when jobs run under tox.

list_unreleased_changes.sh is updated to drop the use of the
virtualenv, which was only present for zuul-cloner.

The other updates in the patch are to change the tools to use the new
script.

Change-Id: Ic559d27881a9a89fb0dcb5295a4d7ed7c578112f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-10-17 15:24:30 -04:00
Doug Hellmann
7fed957392 show the command used to create temporary tag
Change-Id: Ie13eddfe0fdc1268124a6e6c928ac4e7b93bc3c3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-10-16 12:02:57 -04:00
Doug Hellmann
0ea15a31e8 ensure the git user identity is configured
In order for list-changes to tag the repo we need to ensure the git
user identity is set. We do that conditionally to avoid overwriting
local user settings when running the command outside of CI.

Change-Id: I6ac6be1ad1907f19e9ba8850d80460f84d34446c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-10-16 11:34:17 -04:00
Doug Hellmann
70be592ba5 add release notes output to the list-changes job
Import the release-notes command from the release-tools repository and
integrate it with the list-changes command so that we see the release
notes for an upcoming release. This lets us review the release notes
output for warnings (like not having a documentation page linked) and
errors (such as reno failing to work).

Change-Id: I710606fe44601fe5414bfc82f25894319f16e558
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-10-11 13:44:46 -04:00
Doug Hellmann
277b8fc19a use logging module for debug and error reporting
Set up the logging module to print to stdout so we can capture info
about processing in the console log. This patch changes the existing
error and warning print messages, but logging will be more important
when we integrate the reno for release notes printing later.

Change-Id: Ibf94d8527b879b0075516b6bdb26b7f5f266b021
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-10-03 16:24:45 -04:00
Tony Breeds
6434830358 Always resolve branches to a SHA if a tag isn't available
The list changes output of I5485b7ea35be76d7c980e7b222b0c3320770493c
looks 'messy' as some branches do not resolve to a tag.  A shell based
example of what the current code does:

[tony@thor networking-bgpvpn]$ for branch in $(git branch -a | grep -v -- -\> | tr  '[*]' '[ ]') ; do printf "%-30s %s\n" $branch $(git describe --abbrev=0 $branch); done
master                         7.0.0.0rc1
fatal: No tags can describe '8ff78c308a004cdc948c804190d1178d7263781f'.
Try --always, or create some tags.
remotes/gerrit/backport/juno
fatal: No tags can describe '06aa314936eb9a43d358ed75b2e8fef2dadb59d6'.
Try --always, or create some tags.
remotes/gerrit/backport/kilo
remotes/gerrit/master          7.0.0.0rc1
remotes/gerrit/stable/newton   5.0.0
remotes/gerrit/stable/ocata    6.0.0
remotes/gerrit/stable/pike     7.0.0
fatal: No tags can describe '8ff78c308a004cdc948c804190d1178d7263781f'.
Try --always, or create some tags.
remotes/origin/backport/juno
fatal: No tags can describe '06aa314936eb9a43d358ed75b2e8fef2dadb59d6'.
Try --always, or create some tags.
remotes/origin/backport/kilo
remotes/origin/master          7.0.0.0rc1
remotes/origin/stable/newton   5.0.0
remotes/origin/stable/ocata    6.0.0
remotes/origin/stable/pike     7.0.0

Adding --always:
[tony@thor networking-bgpvpn]$ for branch in $(git branch -a | grep -v -- -\> | tr  '[*]' '[ ]') ; do printf "%-30s %s\n" $branch $(git describe --always --abbrev=0 $branch); done
master                         7.0.0.0rc1
remotes/gerrit/backport/juno   8ff78c308a004cdc948c804190d1178d7263781f
remotes/gerrit/backport/kilo   06aa314936eb9a43d358ed75b2e8fef2dadb59d6
remotes/gerrit/master          7.0.0.0rc1
remotes/gerrit/stable/newton   5.0.0
remotes/gerrit/stable/ocata    6.0.0
remotes/gerrit/stable/pike     7.0.0
remotes/origin/backport/juno   8ff78c308a004cdc948c804190d1178d7263781f
remotes/origin/backport/kilo   06aa314936eb9a43d358ed75b2e8fef2dadb59d6
remotes/origin/master          7.0.0.0rc1
remotes/origin/stable/newton   5.0.0
remotes/origin/stable/ocata    6.0.0
remotes/origin/stable/pike     7.0.0

Change-Id: Ic59797ea2c7e2278e8b25f45511009620e6f103a
2017-09-22 08:42:51 -04:00
Doug Hellmann
68fadcd1d7 fix commit_exists() to not rely on commits being on named branches
When we delete stable branches a commit may not appear to be on a
named branch, so validation for old releases may fail even though the
commit is still in the repository. This change uses 'git show' instead
of 'git branch --contains' to separate the tests for existence and
branch membership.

Change-Id: I58213b29bb37c7c428017204a4bdd5235a5816ca
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-09-05 09:34:37 -04:00
Doug Hellmann
2a9af55b8d remove unused master argument from check_branch_sha()
Change-Id: Id52d104cebcc33bb817520af7dbc2685ea962d07
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-08-23 08:44:32 -04:00
Doug Hellmann
4d808671b6 update handling of branches in list-changes
Use the existing heuristic to try to check out the right branch, but
then look at the available branches and if we find a stable branch
with the right series name check that out explicitly and use that name
for the branch so that the gerrit queries include the right
patches. This allows us to see patches on stable branches during the
release candidate period, for example.

Change-Id: Ie7a389acb3d912767a8e35dd0dd86053feb7b3d0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-08-22 16:20:18 -04:00
Doug Hellmann
d99e5737b3 update exists check to look for a commit to be on a named branch
All patches pushed to gerrit are mirrored and then visible through cgit,
so using that web service to check for a "valid" patch does not do what
we thought. This patch changes the logic to look for any named branch to
contain the patch, meaning it has been merged into a branch already
somewhere.

In the course of working on the tests, I also discovered that the one
verifying ancestry of patches being tagged as part of a series was using
the stable/mitaka branch in automaton, which is no EOL. I rewrote the
test to try to be more future-proof.

Change-Id: I2a1c797de4d61649dd047aca28a241c8901e18f3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-08-02 14:34:34 -04:00
Doug Hellmann
d287e47cfc fix stable branch membership detection
The rules for stable branch releases need to be relaxed a bit to account
for projects that are late to create their branches and only do so after
the default branch has been updated. This change makes the rules more
flexible so that it is possible to release for a stable branch on master
as long as that stable branch does not exist. The primary use for this
is to release and then create the stable branch in the same patch.

Change-Id: I2d8f9abcf8ffa34e29eb7021830fd635e6e0f85f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-22 13:36:28 -04:00
Doug Hellmann
6dbce7dd42 make validate work with python 3
Update the check_output() calls used by the validate command so the
results are decoded before being treated as strings.

Change-Id: I099ff997f69743d2958fc5581292aacebd7f5d37
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-03-03 15:00:04 -05:00
Doug Hellmann
1a66ac1929 add tool for verifying late releases are on the right branch
We had at one case where the release validation logic failed to catch a
release from master after the stable/ocata branch was created for
mox3. This script looks at the other "late" releases, created after a
branch, and verifies that they are all on the correct branch.

Change-Id: Ie148a34efa029e6715db099f7e5c9575ed94238d
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-02-07 11:08:44 -05:00
Jenkins
c3807bb2cf Merge "be more rigorous about parsing the branch list" 2017-02-06 14:59:16 +00:00
Jenkins
34bf7b0893 Merge "be smarter about required branch for current series" 2017-02-06 14:58:59 +00:00
Doug Hellmann
52280a7b9c be more rigorous about parsing the branch list
Strip the * indicating which branch is current and drop the lines that
are not named branches.

Change-Id: Ie97b8c6139cf873fc083c3205e7495b65ba49994
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-01-31 15:00:43 -05:00
Doug Hellmann
f16d58e021 check out a specific reference when cloning the repo
When cloning or updating the local copy of the repository, set the
working copy to a specific SHA so the validation steps can look at the
files on the filesystem.

Change-Id: I913b4608eae18c6e85982a5dff3b5388ad80eda6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-01-30 16:09:34 -05:00
Doug Hellmann
26afbba87f be smarter about required branch for current series
In the period between the time when we start creating stable branches
and we update the default series setting it is possible to release from
the wrong branch. Update the check_branch_sha() logic to look for an
existing stable branch and use that, and only default to master if the
series matches and there is no stable branch yet.

Change-Id: I80b0f39c21b55fb8037c1309392f9deaecef20e7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-01-30 13:28:06 -05:00
Doug Hellmann
4305adb190 teach missing-releases to look for artifacts as well as tags
We need a tool to verify that the release artifacts exist on the
tarballs site. The missing-releases command was already looking for
missing tags, so have it look for the tarballs, too.

This change refactors the URL generation code into a separate module so
it can be used by missing-releases and the sphinx extension. It also
creates a reusable function for testing a link, and has the gitutils
module functions responsible for looking for tags, branches, etc. use
it.

Change the default behavior to only look at the most recent release for
each deliverable, and add an option to go back to the previous behavior
of scanning all of them.

Change-Id: Ic7345466ccd83cf2d8d9d6d019107d6fbba171cc
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-12-16 16:05:58 -05:00
Thierry Carrez
a83c2b9975 Validate first tags are on the right branch
For the first tag in the series, we skipped the descendant
check, which means that an existing SHA from a wrong branch
would pass checks. This change adds a branch match check to
cover that specific case and emit an error.

This change removes a warning which was emitted for first
releases, so we adjust the expected warning counts for some
impacted tests.

Change-Id: I741449a11ea68caeadd5be4aef8d0130efb5f5ec
2016-12-01 11:01:36 +00:00
Doug Hellmann
8ed3a71553 add check-diff-start command
Add a tool for reviewing the diff-start values for a final release.

Change-Id: I0d51f766d1cf899bd5c210060b0661a08246669b
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-10-05 11:19:00 -04:00
Jenkins
cf2bff1c14 Merge "make list-changes smarter about the "previous" version" 2016-08-22 11:46:45 +00:00
Doug Hellmann
1227800a37 fix tag detection
Use a separate URL for testing a tag from testing a SHA, since sometimes
the latter does not work for tags.

Change-Id: I01e71df99b0ab81f171f9e69e5190164e20f5106
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-08-16 12:11:47 -04:00
Doug Hellmann
83c16a48fe make list-changes smarter about the "previous" version
The old implementation of list-changes assumed that the deliverable file
included all releases and that they were in order. That assumption does
not hold for independent projects, where the history might not be there
and new entries might be from different branches than the previous
entries, all in the same file. This change uses git to determine the
previous tag for each repository, then shows the right diffs based on
that instead of the assumed tag from the deliverable file.

Change-Id: I122a6ec1792a07cdb23f09a880110dff2446555e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-08-15 16:20:01 -04:00
Doug Hellmann
aa0ca5c34e force a git update of each repo we actually clone
In the CI system we may clone from a repo that doesn't have everything,
such as tags, so after zuul-cloner is done force an update to pull in
the tags.

Change-Id: Ic4b5a217ed142ff83555a0fececb424a1a400fc9
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-07-21 14:28:55 -04:00
Jenkins
a435e4aae3 Merge "new_release: use sha from corresponding stable branches" 2016-05-16 15:19:46 +00:00
Ihar Hrachyshka
64b3319dc9 new_release: use sha from corresponding stable branches
Before the fix, sha values were always extracted from master head, even
when series has a stable branch.

Change-Id: I9810660df7a92c021cd9c154bb3f24d8d828bfd7
2016-04-29 13:20:48 -07:00
Doug Hellmann
bf23735c4a don't clone a repo if it already exists
The validation command in particular ends up cloning the same repo
repeatedly. Skip the extra work by checking to see if it already exists.

Change-Id: If56f03be03e37116edb8ee9443c9ab286c9bbdd9
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-04-21 15:36:29 -04:00
Doug Hellmann
467799296a use zuul cache dir, if it is set or present
Let the validation and list-changes code use the zuul cache directory,
if ZUUL_CACHE_DIR is set or if /opt/git is present (the default for the
CI systems).

Change-Id: Ia6cf24d1361c1112c37e5aeec05546b19798bbbd
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-29 11:46:41 -05:00
Doug Hellmann
902dfa72a4 do not merge stderr & stdout when checking ancestors
The ancestor check depends on finding some output. If we get an error
message, that shouldn't count.

Change-Id: If5c079249d7b32ac6a7418f853a7db06082593bc
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-03 12:31:07 -05:00
Davanum Srinivas
2523637243 Fix pep8 errors
"tox -e pep8" is showing these new errors

./openstack_releases/gitutils.py:52:9: W503 line break before binary operator
./openstack_releases/governance.py:77:21: W503 line break before binary operator
./openstack_releases/cmds/list_changes.py:152:21: W503 line break before binary operator
./openstack_releases/cmds/validate.py:36:1: E402 module level import not at top of file
./openstack_releases/cmds/validate.py:37:1: E402 module level import not at top of file
./openstack_releases/cmds/validate.py:38:1: E402 module level import not at top of file

Change-Id: I4c460928af038fc93ca1057953408f8cc7cac24e
2016-01-12 17:11:01 -05:00
Doug Hellmann
35c4473375 improve error reporting
collect stderr and report it when some of the git query commands fail

Change-Id: I2bcabec71518e32416581f2d0107c45c69795bd3
2015-09-02 23:23:04 +00:00
Doug Hellmann
890aaa12c1 Handle errors from git describe
The git describe command reports errors if there are no tags to be used
to get a description. Trap the errors in places where it is reasonable
to encounter that situation.

Change-Id: I436af248b1740c493b14178cbbe59c8b0474aa94
2015-08-31 14:56:14 +00:00
Doug Hellmann
33dc32f776 Make list-changes smarter
If we can't figure out the previous version from looking in the YAML
file, use git describe to find it.

Show the version number being released in the header of the list-changes
output so we can verify that it matches the expected value after seeing
what sorts of changes are included.

Change-Id: I8f65400900ee0779fd8d1736bf319e638ebbeca0
2015-08-24 18:17:01 +00:00
Doug Hellmann
44244a82a0 add ancestry check to validation
Look for the SHA being assigned a new version in the descendants of the
previous version to ensure it is merged properly.

Change-Id: I82fcb9295bc5eea0c404db898272329dcc515b7b
2015-08-13 21:00:56 +00:00
Doug Hellmann
f39c3879ad separate clone and query operations
Let sha_for_tag assume that the repository already exists, and create a
clone_repo function to be used to enforce that.

Change-Id: Iab9b54cf7a82b70aeebc46a09cab92ccfbe76f4c
2015-08-13 20:31:27 +00:00
Doug Hellmann
17ad4a9bd3 if both tag and sha exist, make sure they match
Update the validate command to compare the actual SHA of a tag with the
one in the file to ensure they match.

Change-Id: I5c04667cbb43cda548c3cc05a47d5a5830b32951
2015-08-04 21:06:13 +00:00
Doug Hellmann
fd5ff7c20a Fix the changed file detection
The merge commits created by zuul do not always list all of the files
being modified, so use git diff instead of git show.

Also force python to use unbuffered I/O so the output comes out in a
useful order instead of mixed up with the subprocess commands.

Change-Id: I5e0e4602e463c05e488537192be8ba59c08644dc
2015-07-27 20:22:11 +00:00
Doug Hellmann
2ab2ca2f9f Add list-changes command and tox environment
Add a tox environment to show the pending changes, if any.

Change-Id: If8a77cf24e8a0ac03dd065c5813960696730b864
2015-07-23 18:17:57 +00:00
Doug Hellmann
7fb906f6d4 Refactor validation script
Move some of the validation code into a real python package so we can
more easily reuse it.

Make the validation script reprint all errors, for cases where it has
checked a lot of files and the original messages might have been mixed
in with other output.

Fix the launchpad project name for tooz so the validation script will
pass.

Change-Id: I17534d460dd9ed19d10e48a0ef5d28dac3ab0fe7
2015-07-23 17:33:03 +00:00