Commit graph

422 commits

Author SHA1 Message Date
Jordan Petridis 07a1480fc9
build_manifest.py: Avoid making the CI variables global
There are half of the variables compared to what was used before,
and now they are only used once so its not needed for them anymore
to be global.

This allows running the tests without needing to pre-define them
in your local environment, since the ones needed are mocked in the
tests code anyway.
2018-11-05 14:31:52 +02:00
Jordan Petridis 2e2864cde7
build_manifest.py: Properly query the group namepsace
Add a function to query groups, so the fallback code will
be functional once gstreamer migrates to gitlab.
2018-11-05 14:31:52 +02:00
Jordan Petridis 490e936dd1
build_manifest.py: Remove an unnecessary if branch
I can't think of a scenario where this would be hit, and can't
trigger make the find_reposiroty_sha function return None either.
2018-11-05 14:31:52 +02:00
Jordan Petridis 64c0e6fba3
build_manifest.py: Remove an early exit branch
find_repository_sha will conclude to the same result so
we can remove the whole if branch and extra variables
that it needed.
2018-11-05 14:31:52 +02:00
Jordan Petridis e042a76031
build_manifest.py: Test the find_repository_sha function 2018-11-05 14:31:52 +02:00
Jordan Petridis 412d980b62
build_manifest.py: Handle bad requests 2018-11-05 14:31:52 +02:00
Jordan Petridis 10b1812e70
build_manifest.py: Use more descriprive variable name 2018-11-05 14:31:52 +02:00
Jordan Petridis 45c89ece12
build_manifest.py: Make the needed env vars global variables 2018-11-05 14:31:52 +02:00
Jordan Petridis 17195ea3aa
build_manifest.py: add a failure test case for branches 2018-11-05 14:31:52 +02:00
Jordan Petridis ea5459e127
build_manifest.py: search user namespaces instead of global
Previously find_repository_sha would do a global search of
all the projects in the gitlab instance. This ports it to
use the user namespace endpoint.

Additionally seems like the else: block never worked.
2018-11-05 14:31:52 +02:00
Jordan Petridis 0b9a8b5cac
build_manifest.py: Add a function to search user namespace of projects
Also fix a type annotation error in the request functions.
2018-11-05 14:31:52 +02:00
Jordan Petridis ca9b1362b3
build_manifest.py: Make sure the remote always ends with a slash
that's how `git-update` in `gst-build` expects it to be
2018-11-05 14:31:52 +02:00
Jordan Petridis dc275a204e
build_manifest.py: Query the exact branch needed 2018-11-05 14:31:51 +02:00
Jordan Petridis 7ad193f276
build_manifest.py: Add a FIXME comment 2018-11-05 11:24:12 +02:00
Jordan Petridis 7ede52d7c7
build_manifest.py: Use the project path not the name
The project path is what's shown in the url bar, ex
gitlab.example.com/john/gstreamer -> path == gstreamer

The project name is defined in project settings and its just.
Its more common to change the name of a fork than its path.
2018-11-05 11:24:12 +02:00
Jordan Petridis 61c5d7b6cf
build_manifest.py: split the request function in two
Make it so it does not depend on env variables so it will be easier
to test.
2018-11-05 11:24:12 +02:00
Jordan Petridis 6772fa76aa
build_manifest.py: Split the hostname resolution from the requests 2018-11-05 11:24:12 +02:00
Jordan Petridis 9c53cd0db0
build_manifest.py: abstract over the gitlab instance base_url 2018-11-05 11:24:12 +02:00
Jordan Petridis 6e77bfb893
build_manifest.py: Use .format instead %s for templates 2018-11-05 11:24:12 +02:00
Jordan Petridis c457ca0570
build_manifest.py: Use fstrings for string formatting 2018-11-05 11:24:12 +02:00
Jordan Petridis 095c93c62c
build_manifest.py: add type annotations 2018-11-05 11:24:12 +02:00
Thibault Saunier a080432a32
gitlab: Add a script to build manifest from a gitlab CI context 2018-10-26 16:36:20 +03:00