Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change auth method in releasepy: remove shared token and use Jenkins API tokens #1201

Merged
merged 13 commits into from
Nov 28, 2024

Conversation

j-rivero
Copy link
Contributor

@j-rivero j-rivero commented Nov 8, 2024

Making @nuclearsandwich happy. Remove the token used in DSL.

  • Change to remove the existing token 19f9405
  • Change the authentication model to use per-user Jekins API tokens: 41d75d8

Developers documentation update: gazebosim/docs#538

This change will break existing nightly scheduler calls. A subsequent PR should take care of it.

@j-rivero
Copy link
Contributor Author

The second commit in the PR changes the auth model from using a job token via GET parameter named 'token' to use a basic_auth model over https using POST. It works with the same config file than the ros_buildfarm code.

@j-rivero j-rivero marked this pull request as ready for review November 12, 2024 19:52
@j-rivero j-rivero changed the title Remove a shared token for triggering builds Change auth method in releasepy: remove shared token and use Jenkins API tokens Nov 13, 2024
import subprocess
import sys
import tempfile
import os
import urllib.parse
import urllib.request
import urllib3
Copy link
Contributor

@scpeters scpeters Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be helpful to document somewhere the python dependencies needed to run release.py. I am using a python venv, so with trial and error I installed the missing dependencies, but it could be clearer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or avoid using libraries outside of the python standard libraries if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be helpful to document somewhere the python dependencies needed to run release.py. I am using a python venv, so with trial and error I installed the missing dependencies, but it could be clearer

I added basic python metadata in ccf062b and updated the documentation in gazebosim/docs#538

Or avoid using libraries outside of the python standard libraries if possible.

Need to double check if we can get rid of urlib3 now that I have clear how the credentials work through GET/POST. Don't want to make more changes in this PR, let's try in a different one.

Copy link
Contributor

@scpeters scpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j-rivero
Copy link
Contributor Author

Note that this needs to wait to be merged to #1206 to be ready

j-rivero and others added 5 commits November 15, 2024 12:14
Provide a cli option to inject credentials designed to work with
nightly. This has the side effect on the test code that we no longer
need the _RELEASEPY_TEST_CREDENTIAL.

Signed-off-by: Jose Luis Rivero <[email protected]>
@j-rivero
Copy link
Contributor Author

Testing the nightly run with --dry-run. The output seems promising:

https://build.osrfoundation.org/job/ignition-__upcoming__-nightly-scheduler/26/console

...
+ echo 'releasing gz-tools3 (from branch main)'
releasing gz-tools3 (from branch main)
+ python3 ./scripts/release.py --dry-run gz-tools3 nightly --auth osrfbuild:**** --release-repo-branch main --nightly-src-branch main --upload-to-repo nightly
Downloading releasing info for gz-tools3
Linux distributions in the -release repository:
 + focal  ('amd64', 'armhf', 'arm64')
 + jammy  ('amd64', 'armhf', 'arm64')
Safety checks:
 + OK No underscore in package name
 + OK Package names in changelog and control
 + OK Jenkins credentials are good
Simulation of jobs to be called if not dry-run:
 + Releasing ubuntu focal/amd64 in https://build.osrfoundation.org//job/gz-tools3-debbuilder?search=nightly-1
 + Releasing ubuntu jammy/amd64 in https://build.osrfoundation.org//job/gz-tools3-debbuilder?search=nightly-1
+ echo ' - done'
...

Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
@j-rivero j-rivero force-pushed the jrivero/remove_the_longest_token_ever branch from c0b5473 to 2a070f8 Compare November 26, 2024 17:06
@j-rivero
Copy link
Contributor Author

Added a warning for the developers using the current shared token 2a070f8

@j-rivero j-rivero merged commit bc7d636 into master Nov 28, 2024
1 check passed
@j-rivero j-rivero deleted the jrivero/remove_the_longest_token_ever branch November 28, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants