21 Commits

Author SHA1 Message Date
Doug Hellmann
c469a09998 Fix project requirements check to work with "extras"
Process "extras" defined in a project setup.cfg properly by looping over
the dictionary's member items and not the dictionary itself.

Do not compare comments associated with requirements, since those are
always collected as a set of unnamed requirements and many of the
comments from global-requirements.txt are not needed in the local
project file (especially when the dependencies for which the comments
are relevant are not used).

Change-Id: I78838dcd4da43b3c1d2610ac87a3ec55b9535646
2015-07-10 18:20:34 +00:00
Robert Collins
4333eff8a4 Don't apply strict parsing rules to stable branches.
Reasoning is:
 - devstack etc protect us from functional issues
 - we're backporting to stable, so guarding against
   aesthetics and DRY concerns is not our business anymore
 - if in future we have other not-functional linty style
   things to add, we don't want them to affect stable
   either.

Change-Id: I8e891b8fdb6acfdf5e7e084467ee8596f51c251a
2015-07-03 10:04:23 +12:00
Robert Collins
1508a4c88c Really fix requirement checking.
- Don't show the present-in-multiple files message unless it really is.
- Don't error on the target branch.
- Do error on the branch being submitted.
- Output what files we've looked at.
- Output what branch we're looking at.

Change-Id: I1d254c42e0bc2550ceeb768532448b5797d87caf
2015-07-01 14:31:12 +12:00
Robert Collins
0d4fc25212 Don't fail on dupes in version specific files
The rot won't be unwound for another 6-12 months, and we're not
backporting all the infrastructure to do markers to older releases. So
we need to warn only, rather than erroring, when encountering this
situation.

Change-Id: Ib63996b016f7f99f69ad1255c333cc2d1846cbdb
2015-06-30 15:33:04 +12:00
Robert Collins
b7a7641677 Use the requirements parser.
This switches the requirements parser from a local one to using the
reference one in openstack/requirements. To do that I install the
openstack/requirements we're testing against in a virtualenv and
import it. We could if wanted install that separately and run it
against a just in time checkout, but this should be reliable for now
(though the need to encode a python path in a venv is a little ugly).

Change-Id: I1f77a2e0eaa7046928642cf0b9e2c490a851a303
2015-06-28 08:16:14 +00:00
Robert Collins
489bc6b6de Prepare for using requirements library.
openstack_requirements has a library now. To use it we need to do all
our reading of requirements after requirements is available.

Change-Id: I53f7a16b4b28d8234192ab1845e4a337ba7a8328
2015-06-28 08:14:39 +00:00
Robert Collins
7b6b4500e7 Remove deprecated dev-requirements support.
Change-Id: I8ae1eeb4daa25715ff02187e3e4c34a3d1c883a4
2015-06-28 08:13:22 +00:00
Robert Collins
8b8f7526d7 Allow using custom requirements trees.
This makes testing with unlanded requirements patches way easier.

Change-Id: Ia3b986a9eb58d93ad239ef077a6069be958170a0
2015-06-28 10:12:21 +02:00
Robert Collins
4152062027 Fix leaks of tempdirs.
If interrupted tempdirs are currently leaked. Context managers reduce
the ability for this to happen.

Change-Id: Ia7adf5f2ec8d8a327802194c88f20b22200f12cf
2015-06-26 15:45:51 +12:00
Robert Collins
ef696e4ef6 Make it possible to use a regular zuul-cloner.
Testing locally with a pip installed zuul is easy with this new option
- --zc zuul-cloner and the zuul-cloner from the PATH is user.

Change-Id: Ib0c97df4be9c378bab4ff98f06c27ff771810ce9
2015-06-26 15:45:08 +12:00
Jeremy Stanley
2640b85cfe Simplify requirements check run_command invocation
Since run_command() already strips stdout and stderr before
returning them, there's no need to strip them again later.

Change-Id: Id5e16c57f5371dcb4a3fd532faaf52712e38c75c
2015-03-24 23:25:09 +00:00
Jeremy Stanley
62551ed16e Strip the correct return value from rev parse
The run_command() function now returns a tuple of stdout and stderr,
so its result cannot be directly manipulated as a string.

Change-Id: Ifea1c56046e74db7531cd8a687a9591424df5d6c
2015-03-24 23:18:15 +00:00
Clark Boylan
bd5600aa78 Fix destination for requirements clone dest
In the requirements checking job we need to clone the requirements repo
into the tmpdir that the test creates for the repo. Otherwise subsequent
dir changes end up failing because the dir they attempt to change into
fails.

While we are at it print the stdout and stderr written by zuul cloner to
aid in debugging.

Change-Id: Id39140ac2a0ccbaf9a9ac0f6f76350c539048670
2015-03-24 11:32:55 -07:00
James E. Blair
560863c7ed Use zuul-cloner in project-requirements-change
This will use the typcial Zuul branch fallback logic.  The current
branch parameter to this script is ZUUL_BRANCH, so the logic is
equivalent.

Also, adjust the test for include_dev so that dev versions are
permitted for master and feature branches.

Change-Id: I22f8d1b40c28fa3f35105da1e02574a1a0bf1556
2015-03-23 15:02:07 -07:00
James E. Blair
b9fbab8dcb Clone from git.o.o rather than review.o.o
New version of git running on review.o.o does not work with shallow
clones.  But we shouldn't be cloning from review.o.o anyway.  Use
the more robust git.o.o instead.

Change-Id: I4a9b4dd9da5d52e39373bee0462abaee13c462ce
2015-03-21 13:12:52 -07:00
Davanum Srinivas
291b578f6b Support running script against local changes
Some projects do not strictly enforce requirements changes and
developers in those project need a way to see how far away they
are from the global requirements. So we need a way to run this
script to figure out which of those items in global requirements
they would like to update in their projects.

Adding a --local optional flag and defaulting the branch to 'master'
seems to support both existing usecases in gate and the local
use case as detailed above

Change-Id: I76fcea1e2965795ebb99f2b7d649cf9a53908f09
2014-12-07 02:05:56 +00:00
Jenkins
ed805cc36b Merge "Make existing requirements parsing more forgiving" 2014-11-18 14:24:05 +00:00
Jeremy Stanley
d63c07f97e Make existing requirements parsing more forgiving
* jenkins/scripts/project-requirements-change.py: If not reading
requirements in strict mode, for example when analyzing the existing
branch tip copy of a list, allow for the possibility that
pkg_resources may be incapable of parsing what it sees as a
malformed version string.

Change-Id: I8e13a5e94901f615233ddfb4a5e4589841a01853
2014-11-14 20:32:52 +00:00
Oleksii Chuprykov
853bd1a554 Check requirements correctly
Requirements check job doesn't correctly work on stable branches
of openstack projects

Closes-Bug: #1391905

Change-Id: Id470777bbc01dae4ceab713c243e691004afe74f
2014-11-14 15:50:14 +02:00
Davanum Srinivas
ee752a6d3a Typo olso -> oslo
Change-Id: I7d3fe86b7359ee524dae83e44036b6f6fb132be7
2014-10-03 08:19:23 -04:00
Anita Kuno
1d21cd635f Reorganizes project-config
This repo was created from filter branching the openstack-infra/
config repo. This process brought a lot of cruft with it in the
form of directories that we no longer need. This patch removes
that cruft so we begin with a tidier repo.

Change-Id: Ibffad1b11c0c5f84eedfb0365369f60c4961a0f3
2014-09-25 11:41:04 -04:00