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 Copr support into modules #344

Merged
merged 2 commits into from
Jul 14, 2023
Merged

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Apr 7, 2023

Start of re-factoring into modules based on our learning from Koji interaction. One aspect of this is how we define the data, while I am going to work on tests, I thinking of a data structure like this:

      copr_repo_name: 'foreman-nightly'
      chroots:
        - name: rhel-9-x86_64
          external_repo:
          modules:
        - name: rhel-8-x86_64
          external_repo:
          modules:
        - name: rhel-7-x86_64
          external_repo:
          modules:

@ehelms
Copy link
Member Author

ehelms commented Apr 11, 2023

Will require #345 to go in first and be rebased on how the modules work there.

@ehelms ehelms force-pushed the refactor-copr branch 2 times, most recently from 9681962 to 8b9bf8d Compare April 20, 2023 20:28
@ehelms ehelms force-pushed the refactor-copr branch 2 times, most recently from d49c59f to cc94cfe Compare May 5, 2023 19:03
@ehelms ehelms marked this pull request as ready for review May 5, 2023 19:04
@ehelms
Copy link
Member Author

ehelms commented May 5, 2023

I have updated this with a rebase onto master, and pushing up all the changes from testing builds locally.

@ehelms
Copy link
Member Author

ehelms commented May 12, 2023

@evgeni
Copy link
Member

evgeni commented May 16, 2023

% ./tests/fixtures/mockbin/copr-cli 
/home/evgeni/Devel/theforeman/obal/./tests/fixtures/mockbin/copr-cli:10: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  from pipes import quote
{}

that ain't no valid json? :-)

Fix: #349

@ehelms
Copy link
Member Author

ehelms commented May 16, 2023

% ./tests/fixtures/mockbin/copr-cli 
/home/evgeni/Devel/theforeman/obal/./tests/fixtures/mockbin/copr-cli:10: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  from pipes import quote
{}

that ain't no valid json? :-)

Fix: #349

Thanks! I need to squint harder next time.

@ehelms
Copy link
Member Author

ehelms commented May 16, 2023

This is ready for review. It is helpful to review it with respect to theforeman/foreman-packaging#9290 as that gives it some real world feel.

@ehelms
Copy link
Member Author

ehelms commented Jul 8, 2023

@evgeni What would you recommend we do here? Drop 2.7 support or test it via a different method?

  Warning: The support for python 2.7 will be removed on June 19. Related issue: https://github.com/actions/setup-python/issues/672
  Version 2.7 was not found in the local cache
  Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04.

@ehelms ehelms force-pushed the refactor-copr branch 2 times, most recently from c80c28f to 1931a35 Compare July 10, 2023 23:19
try:
package_info = json.loads(copr_cli(command, config_file=config_file))
except CoprCliCommandError as error:
if "Error: No package with name {} in copr {}".format(package, project):
Copy link
Member

Choose a reason for hiding this comment

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

this is if <a string>: which is always true, did you forget to match against some output?

Copy link
Member

Choose a reason for hiding this comment

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

Rather than matching here, can we catch this in copr_cli and implement a specific CoprPackageRetrievalError exception (which subclasses CoprCliCommandError?

@evgeni
Copy link
Member

evgeni commented Jul 12, 2023

@evgeni What would you recommend we do here? Drop 2.7 support or test it via a different method?

  Warning: The support for python 2.7 will be removed on June 19. Related issue: https://github.com/actions/setup-python/issues/672
  Version 2.7 was not found in the local cache
  Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04.

I'd prefer fixing CI (I started in #352), but that shouldn't be a blocker for now.

Copy link
Member

@evgeni evgeni left a comment

Choose a reason for hiding this comment

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

I've posted a few questions inline, but only the if <a string>: I'd consider blocking. Feel free to merge in my absence once that one is cleaned out.

obal/data/modules/check_copr_build.py Outdated Show resolved Hide resolved
obal/data/modules/copr_build.py Outdated Show resolved Hide resolved
@ehelms ehelms force-pushed the refactor-copr branch 8 times, most recently from 4131bcf to d5de731 Compare July 14, 2023 01:26
@ehelms
Copy link
Member Author

ehelms commented Jul 14, 2023

The Python 2.7 tests are currently known to be broken, attempting to be fixed over here -- #352

@ehelms ehelms merged commit 7c5247a into theforeman:master Jul 14, 2023
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.

3 participants