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

Refactor utils.py #637

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Refactor utils.py #637

wants to merge 2 commits into from

Conversation

cvicentiu
Copy link
Member

This PR introduces two changes:

  1. Introduce type hints.
  2. Clean up branch-prioritisation logic.
  3. Removes unused code

The branch prioritisation logic should be double checked.

@@ -19,6 +19,7 @@ sys.setrecursionlimit(10000)
sys.path.insert(0, "/srv/buildbot/master")

from utils import *
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we take that refactor opportunity to remove the wildcard import?

Copy link
Member Author

@cvicentiu cvicentiu Nov 26, 2024

Choose a reason for hiding this comment

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

master.cfg will come next, in a separate PR :)

@@ -123,7 +120,7 @@ def createWorker(
docker_host=private_config["private"]["docker_workers"][worker_name],
image=image_str,
dockerfile=dockerfile_str,
tls=tls,
tls=None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was always passed as none. See the deletion from above. I just made it obvious.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@fauust fauust Nov 26, 2024

Choose a reason for hiding this comment

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

Ok for most of the worker, this is fine since we use wireguard, no reason to use extra layer of security. But we have still a bunch of workers that communicate on the public IP, @RazvanLiviuVarzaru now that you have a better overview could you please double check that point and if that applies here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Indeed it was always None as default on every function call.
Shouldn't affect existing workers configured via createWorker function.

I propose to set tls with default value None as a function argument, for future scenarios where wireguard is not an option.
Having it as an argument is clear enough for the caller also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants