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

cachi2: conversion function to cachi2 params #2092

Open
wants to merge 1 commit into
base: feature_cachi2
Choose a base branch
from

Conversation

MartinBasti
Copy link
Contributor

@MartinBasti MartinBasti commented Jul 16, 2024

Conversion function that transforms remote_source into cachi2 params

STONEBLD-2586

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Python type annotations added to new code
  • [-] JSON/YAML configuration changes are updated in the relevant schema
  • [-] Changes to metadata also update the documentation for the metadata
  • [-] Pull request has a link to an osbs-docs PR for user documentation updates
  • [-] New feature can be disabled from a configuration file

@MartinBasti MartinBasti force-pushed the cachi2-params-conversion branch 4 times, most recently from 4bef433 to 25013bb Compare July 17, 2024 11:07

Remote sources were orignally designed for cachito. Cachi2 is not a direct
fork but has lot of similarities.
However, some parameters must be updated to be compatible with cachi2."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we include more information about the parameters? Or are we expecting that we will always remove only the "include-git-dir" and "remove-unsafe-symlinks" flags?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

only these 2 flags as it's job for OSBS in future, and also that pkg manager Adam mentioned in #2092 (comment)

packages = remote_source.get("packages", {}).get(pkg_manager, [])
packages = packages or [{"path": "."}]
for pkg in packages:
cachi2_packages.append({**{"type": pkg_manager}, **pkg})
Copy link
Contributor

Choose a reason for hiding this comment

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

nipick: the intermediate {"type": "pkg_manager"} dict is unnecessary

{"type": pkg_manager, **pkg}

atomic_reactor/utils/cachi2.py Show resolved Hide resolved
@MartinBasti
Copy link
Contributor Author

Addressed comments, PTAL

Conversion function that transforms remote_source into cachi2 params

STONEBLD-2586

Signed-off-by: Martin Basti <mbasti@redhat.com>
Copy link
Contributor

@chmeliik chmeliik left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

None yet

3 participants