Skip to content

Conversation

@rohanpm
Copy link
Contributor

@rohanpm rohanpm commented Jun 3, 2021

ET requests modules by filename, e.g. modulemd.x86_64.txt.

Previously, we had errata source query koji source and then filter
the returned values according to ET's desired filenames. Let's
instead make koji source natively support filtering by way of a new
parameter.

Motivation: koji source will soon need to start parsing these
modulemd files so that the NSVCA can be put onto push items.
If we do this for files which will be then filtered by the errata
source, we're negatively impacting the performance and reliability
by loading data we don't need. It's better if we can tell koji
source in advance exactly which files we're interested in.

@rohanpm
Copy link
Contributor Author

rohanpm commented Jun 3, 2021

Because I've had a lot of pull requests for this repo with some dependencies between them, I'm trying a "stacked pull request" workflow at the moment. This is the reason why this PR is using this repo as the source, rather than using my fork.

@rohanpm rohanpm marked this pull request as ready for review June 3, 2021 23:28
@rohanpm rohanpm force-pushed the rohan/modulemd-filter branch from e9208eb to 1876842 Compare June 4, 2021 00:14
def _module_filtered(self, file_path):
ok_names = self._module_filter_filename
filename = os.path.basename(file_path)
if ok_names != None and filename not in ok_names:
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal I guess, but ok_names is not None should be used when comparing to None or probably only if ok_names and filename not in ok_names: can be used as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree on the "is not None", fixed it.

I don't think it would be right to make it just "if ok_names and ...". The reason is that it loses the distinction between "caller didn't request any filtering" and "caller requested filtering to an empty list". Asking to filter to an empty list might seem weird since you're always going to get nothing back, but in the long run I think treating an empty list differently to lists of any other length will end up more confusing.

ET requests modules by filename, e.g. modulemd.x86_64.txt.

Previously, we had errata source query koji source and then filter
the returned values according to ET's desired filenames. Let's
instead make koji source natively support filtering by way of a new
parameter.

Motivation: koji source will soon need to start parsing these
modulemd files so that the NSVCA can be put onto push items.
If we do this for files which will be then filtered by the errata
source, we're negatively impacting the performance and reliability
by loading data we don't need. It's better if we can tell koji
source in advance exactly which files we're interested in.
@rohanpm rohanpm force-pushed the rohan/modulemd-filter branch from 1876842 to c94e351 Compare June 8, 2021 22:16
@rohanpm rohanpm merged commit f5d2039 into master Jun 9, 2021
@rohanpm rohanpm deleted the rohan/modulemd-filter branch June 9, 2021 06:20
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.

2 participants