-
Notifications
You must be signed in to change notification settings - Fork 37
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
ci: autodetect cargo deb crates #101
Conversation
0d6628e
to
1ed5756
Compare
1ed5756
to
728c8a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
targets = ["aarch64", "x86_64"] | ||
def find_cargo_deb_crates(): | ||
jq_query = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative in Python would be (something along these lines):
metadata = json.loads(cmd_output)
workspace_members = set(metadata['workspace_members'])
crates = [
package['name']
for package in metadata['packages']
if package['id'] in workspace_members and 'deb' in package.get('metadata', {})
]
I personally find it more understandable. But I'll leave this to you.
Is jq
always available btw? Because with pure python implementation you have the advantage of "peace of mind".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we ensure that jq is always available via the nix flake. But yes, I think I prefer the python approach more. Also, I know python more than I know jq. I'll open a new PR to port it.
) | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Builds rust artifacts for CI") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nit for whenever (if) you have time: It would be amazing to have a description that our artifacts are actually debian packages, and also have the description declaring what are the assumptions under which we can build a debian.
Lets us stop having to manually write out the list of binaries. Also will allow us to reuse this workflow in orb-internal, since it is no longer specific to this repo.
Also seeking opinions: Would it be better for me to keep the json parsing in jq, or do you want me to port it to native python?