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

Fix: EOL filtering to only exclude builds with no valid tracks. #272

Merged
merged 41 commits into from
Nov 14, 2024

Conversation

clay-lake
Copy link
Contributor

@clay-lake clay-lake commented Oct 21, 2024


Included in this PR:

  • Fix EOL filtering to only exclude builds with no valid tracks.
  • Refactor of src/image/prepare_single_image_build_matrix.py.
  • Upgrade pydantic to 2.8.2 globally.
  • Respective testing for EOL handeling.
  • Testing for image trigger file validator.

@clay-lake clay-lake marked this pull request as ready for review October 21, 2024 10:08
@clay-lake clay-lake requested a review from a team as a code owner October 21, 2024 10:08
Copy link
Contributor

@zhijie-yang zhijie-yang left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Nicely done. A few nitpicks regarding the formatting. I would also suggest use isort to sort the imports ;)

src/image/requirements.txt Show resolved Hide resolved
tests/unit/test_image_trigger_file_validator.py Outdated Show resolved Hide resolved
tests/unit/test_prepare_single_image_build_matrix.py Outdated Show resolved Hide resolved
tests/unit/test_prepare_single_image_build_matrix.py Outdated Show resolved Hide resolved
tests/unit/test_image_trigger_file_validator.py Outdated Show resolved Hide resolved
src/image/prepare_single_image_build_matrix.py Outdated Show resolved Hide resolved
src/image/utils/schema/triggers.py Show resolved Hide resolved
tests/unit/test_image_trigger_file_validator.py Outdated Show resolved Hide resolved
Copy link
Contributor

@zhijie-yang zhijie-yang left a comment

Choose a reason for hiding this comment

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

We will omit the blank line after the docstring in this PR as per the discussion offline. Looks good to me. Thanks.

clay-lake and others added 18 commits November 11, 2024 15:31
@@ -67,21 +67,26 @@

print(f"Parsing image trigger {args.image_trigger}")
with open(args.image_trigger, encoding="UTF-8") as trigger:
image_trigger = ImageSchema(**yaml.load(trigger, Loader=yaml.BaseLoader))
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey,

Just to know, Why changing this ?

Copy link
Contributor Author

@clay-lake clay-lake Nov 14, 2024

Choose a reason for hiding this comment

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

I had to make some changes when updating to pydantic v2. L78 was failing on both the old .dict and new .dump_model methods, so I just kept the image_trigger as a dict, and use the model only for validation like we do in most of the repo.

78: for risk, value in risks.dict(exclude_none=True).items():

@clay-lake clay-lake merged commit 2818740 into main Nov 14, 2024
Copy link
Contributor

@zhijie-yang zhijie-yang left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Once these nitpicks are fixed, I can approved this PR.

pydantic==2.8.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pydantic==2.8.2
pydantic==2.8.2

Comment on lines +9 to +20
from typing import Any
from pathlib import Path
from git import Repo
from tempfile import TemporaryDirectory as tempdir
from copy import deepcopy
import logging


from ..uploads.infer_image_track import get_base_and_track
from ..shared.github_output import GithubOutput
from .utils.schema.triggers import ImageSchema
from .utils.schema.revision_data import RevisionDataSchema
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 use isort to sort the imports?

@clay-lake clay-lake deleted the fix_eol_filtering branch November 15, 2024 14:45
clay-lake added a commit that referenced this pull request Nov 18, 2024
* refactor: applied suggetsions from zhijie-yang in #272

---------

Co-authored-by: clay-lake <clay-lake@localhost>
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.

4 participants