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

pre_resolve_module_compose.py: Handle change to module separator #921

Merged

Conversation

owtaylor
Copy link
Contributor

It was officially decided that module versions are formatted as N:V:R not N-V-R.
ODCS on input accepts either, so keep on passing N-V-R, but we need to accept
N:V:R if we receive it.

@owtaylor
Copy link
Contributor Author

Will redo this against current master when I get a chance.

owtaylor added a commit to owtaylor/osbs-box that referenced this pull request Feb 15, 2018
m = re.match(r'^(.+)-([^-]+)$', module)
if not m:
raise RuntimeError(
'Module specification should be NAME:STREAM or NAME:STREAM:VERSION. (NAME-STREAM and NAME-STREAM-VERSION supported for compatibility.)')

Choose a reason for hiding this comment

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

E501 line too long (148 > 100 characters)

@owtaylor owtaylor force-pushed the module-separator-change branch 2 times, most recently from 96cefce to 1f7a0e5 Compare February 16, 2018 04:59
@owtaylor
Copy link
Contributor Author

Rebasing over the change introducing container.yaml to this plugin found some problems, fixed up here in a pre-patch.. The fixes aren't directly related to the separator, but included here to avoid having dependent pull requests.

@twaugh
Copy link
Member

twaugh commented Feb 16, 2018

Looks great!

I tried verifying the test changes in the first commit by undoing the change to the plugin, but it is still passing. I'm not sure it's testing it right.

@mlangsdorf mlangsdorf self-requested a review February 16, 2018 13:11
raise RuntimeError(
'Module specification should be NAME:STREAM or NAME:STREAM:VERSION. ' +
'(NAME-STREAM and NAME-STREAM-VERSION supported for compatibility.)'
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be rewritten with a list of patterns and a for/break/else iterator. I don't think it would be much shorter, but it would be easier to extend in the future.

The repeated if not m statements aren't wrong, but something about them bothers me.

@owtaylor
Copy link
Contributor Author

I tried verifying the test changes in the first commit by undoing the change to the plugin, but it is still passing. I'm not sure it's testing it right.

When I revert the change to the plugin and just have the test changes from the first commit, I get 14/20 fails for 'pytest-3 tests/plugins/test_resolve_module_compose.py. Not sure what I'm doing differently.

The 'cleanup flatpaks' commit that switched to reading modules from
container.yaml contained a typo:

   if not self.data or not self.compose_ids:
       raise RuntimeError('"compose" config not set and compose_ids not given')

(Note "or" vs. "and") which meant that large sections of the tests didn't
work as expected. Fix the handling of module/compose IDs to make sense:

  container.yaml needs to be present and contain at least one module
  in the compose section whether or not compose_ids is set.

Remove a couple of unneeded tests from the parameterization.
Module versioning was changed from NAME-VERSION-RELEASE to a new format
with colons - NAME:VERSION:RELEASE (and other variants.) We could get either
format from the compose server when resolving modules, depending on how recent
a version it is, so accept either format.
@owtaylor
Copy link
Contributor Author

Pushed a new version that improves a commit message, fixes an error message ('s required Flatpak' => is required for Flapaks), and changes the construct that @mlangsdorf didn't like. I don't have a strong opinion as long as there's not indefinite nesting of ifs.

@twaugh
Copy link
Member

twaugh commented Feb 19, 2018

Oh, the tests were being skipped because I didn't have modulemd or pdc_client installed. Sorry for the noise.

@mlangsdorf mlangsdorf merged commit 4d88aec into containerbuildsystem:master Feb 19, 2018
@twaugh
Copy link
Member

twaugh commented Feb 19, 2018

Draft release notes updated.

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

4 participants