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

Heldkat patch 1 #1128

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Heldkat patch 1 #1128

merged 1 commit into from
Jan 24, 2025

Conversation

heldkat
Copy link
Contributor

@heldkat heldkat commented Jan 22, 2025

Release note:

update of output file path

@gardener-robot gardener-robot added needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Jan 22, 2025
@CLAassistant
Copy link

CLAassistant commented Jan 22, 2025

CLA assistant check
All committers have signed the CLA.

@@ -256,8 +256,8 @@ def resource_as_dict(component, resource, resource_id):
resource_as_dict(c,r,i) for c,r,i in removed_resource_version_ids
])))

outfile_new = f'{parsed.outfile_prefix}-added.yaml'
outfile_removed = f'{parsed.outfile_prefix}-removed.yaml'
outfile_new = f'os.environ['SOURCE_PATH']+'/versionDiff/{parsed.outfile_prefix}-added.yaml'
Copy link
Member

Choose a reason for hiding this comment

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

that won't work (syntax-error). also I think it is not nice to hardcode assumptions about presence of SOURCE_PATH-env-var. as discussed out-of-bands, check whether passing --outfile-prefix via ARGV might solve what you are trying to achieve

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 adapted the file to set the outfile_prefix parameter to None, so that I can call it with a self-defined string. Would this work?

Copy link
Member

Choose a reason for hiding this comment

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

@heldkat : well... in principal: yes. however, this will de-facto turn the (thus-far optional) parameter into a required one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about now? This would give me the option to define it in the defaults-file but does not require it in my understanding

Copy link
Member

@ccwienk ccwienk left a comment

Choose a reason for hiding this comment

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

please fix whitespace-nit. otherwise lgtm

@@ -68,7 +69,7 @@ def diff(
ocm_repo_urls: [str]=None,
cache_dir: str=_cfg.ctx.cache_dir,
defaults_file: str=None,
outfile_prefix: str='resource-diff'
outfile_prefix: str= 'resource-diff'
Copy link
Member

Choose a reason for hiding this comment

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

I think according to our linter-rules (and pep8), there should not be a whitespace after = here (also, whitespace should be used consistently at least within one codeblock)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, perfect. I was wondering why it is not passing the linter test

ocm_repo_urls: list[str]
exclude_component_names: list[str] = None
exclude_component_resource_names: list[ComponentResourceNames] = None
resource_types: list[str] = None
name_template: str = None
name_template_expr: str = None
outfile_prefix: str = 'resource-diff'

Copy link
Member

Choose a reason for hiding this comment

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

I think this is one line too much (pep8 and our linter mandates exactly two lines - see linter output (linked to your pullrequest))

Copy link
Member

@ccwienk ccwienk left a comment

Choose a reason for hiding this comment

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

also, please squash commits into just one

Changing output file paths in def_diff

Update compliance.py

Update compliance.py

Update compliance.py

Update compliance.py

Update compliance.py

Removing whitespace to adhere to linter rules

Update compliance.py

Update compliance.py

Update compliance.py

Update compliance.py
@heldkat heldkat merged commit ca6173c into master Jan 24, 2025
14 checks passed
@heldkat heldkat deleted the heldkat-patch-1 branch January 24, 2025 15:52
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/changes Needs (more) changes needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants