Skip to content

Conversation

@midnightercz
Copy link
Member

@midnightercz midnightercz commented Mar 26, 2020

Added 'population_sources' and 'ubi_population'

@midnightercz midnightercz force-pushed the population_sources branch 2 times, most recently from 5492dfa to 7dca97f Compare March 26, 2020 12:40
rbikar
rbikar previously approved these changes Mar 26, 2020
Comment on lines 79 to 86
ubi_population = pulp_attrib(
default=False, type=bool, pulp_field="notes.ubi_population"
)
"""Flag indicating whether repo should be populated or not
"""
Copy link
Member

Choose a reason for hiding this comment

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

This change isn't mentioned in the commit msg. Please update it, thx.

Copy link
Contributor

@rohanpm rohanpm left a comment

Choose a reason for hiding this comment

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

Could you please also add the new attributes into the schema at pubtools/pulplib/_impl/schema/repository.yaml ?

That schema is partly for documentation but also to make it fail in a controlled way if fields contain data of the wrong type.

type = pulp_attrib(default="rpm-repo", type=str, pulp_field="notes._repo-type")

population_sources = pulp_attrib(
default=(), type=tuple, converter=tuple, pulp_field="notes.population_sources"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please make this consistent with the other "immutable collection" attributes, i.e. use FrozenList?

So that would be something like:

Suggested change
default=(), type=tuple, converter=tuple, pulp_field="notes.population_sources"
default=attr.Factory(FrozenList), type=list, converter=FrozenList, pulp_field="notes.population_sources"

ubi_population = pulp_attrib(
default=False, type=bool, pulp_field="notes.ubi_population"
)
"""Flag indicating whether repo should be populated or not
Copy link
Contributor

Choose a reason for hiding this comment

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

population_sources gives the impression of something a bit generic but this one is named specifically relating to UBI. I guess the doc should be slightly more detailed then, like:

Suggested change
"""Flag indicating whether repo should be populated or not
"""Flag indicating whether repo should be populated or not for the purposes of UBI



def test_populate_attrs():
"""skip_rsync_repodata is initialized from distributors when possible"""
Copy link
Contributor

Choose a reason for hiding this comment

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

This doc string is wrong, copy-pasted I guess?

@midnightercz midnightercz changed the title Added population_sources attribute for yum repositories Added population attributes for yum repositories Mar 27, 2020
@midnightercz midnightercz requested review from rbikar and rohanpm March 27, 2020 12:01
negillett
negillett previously approved these changes Mar 27, 2020
Copy link
Contributor

@rohanpm rohanpm left a comment

Choose a reason for hiding this comment

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

Just realized it's missing a CHANGELOG.md entry too, could you please add something there?

rbikar
rbikar previously approved these changes Apr 2, 2020
negillett
negillett previously approved these changes Apr 2, 2020
ubi_population = pulp_attrib(
default=False, type=bool, pulp_field="notes.ubi_population"
)
"""Flag indicating whether repo should be populated or not for the purposes of UBI
Copy link
Contributor

Choose a reason for hiding this comment

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

may mention '...populated from population_sources' just to be consistent with the comment in repository.yaml

midnightercz and others added 4 commits April 3, 2020 11:22
- fixed docs strings
- added new attributes to schema file
Co-Authored-By: Rohan McGovern <rohan@mcgovern.id.au>
Co-Authored-By: Rohan McGovern <rohan@mcgovern.id.au>
@midnightercz midnightercz dismissed stale reviews from negillett and rbikar via 2b8c22d April 3, 2020 09:23
rbikar
rbikar previously approved these changes Apr 6, 2020
negillett
negillett previously approved these changes Apr 6, 2020
Co-Authored-By: Rohan McGovern <rohan@mcgovern.id.au>
@midnightercz midnightercz dismissed stale reviews from negillett and rbikar via 1ebf02c April 7, 2020 08:32
@midnightercz midnightercz merged commit 02f9f3e into release-engineering:master Apr 8, 2020
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.

5 participants