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

Add build processors #128

Open
wants to merge 30 commits into
base: cli-redesign
Choose a base branch
from
Open

Conversation

jddarby
Copy link
Owner

@jddarby jddarby commented Dec 14, 2023


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

jddarby and others added 14 commits November 29, 2023 12:32
* Initial ArmInputTemplate class

* Outline ArmBuildProcessor hierarchy

* Update VNF tests to keep built output for comparison

* Initial ArmInputTemplate class

* Outline ArmBuildProcessor hierarchy

* Update VNF tests to keep built output for comparison

* WIP, for sharing with Jacob

* Incremental update

* Approximately complete ARM processor. No tests, no testing yet.

* Fix artifact store reference

---------

Co-authored-by: Andy Churchard <andy.churchard@metaswitch.com>
@jddarby jddarby requested a review from sunnycarter as a code owner December 14, 2023 14:18
"publisherName": publisher_name,
"nfdgName": nfdg_name,
"nfdvName": self.network_function_definition.name,
"publisherResourceGroup": publisher_resource_group,
Copy link
Collaborator

Choose a reason for hiding this comment

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

publisher_name, nfdg_name and publisher_resource_group are only defined if line 54 (if self.network_function_definition.id:) is True.

What happens if line 54 is false? We'll get an undefined variable error, right?

:return: The resource element template.
:rtype: NFDResourceElementTemplate
"""
logger.info("Generating resource element template for NFD input.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
logger.info("Generating resource element template for NFD input.")
logger.info("Generating resource element template for %s NFD input.", self.name )

logger.error("VHDFileInput must have either a file path or a blob SAS URI.")
raise ValueError(
"VHDFileInput must have either a file path or a blob SAS URI."
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels like the wrong place to be doing this validation. It should have been validated before it gets to the processors.

If this is duplicate validation, let's delete it. If it hasn't been validated before this (or we don't know), let's leave it as is for now, but add to a todo list (probably related to Pydantic).


for file in template_dir.iterdir():
# Template files are only ever YAML files.
if file.name.endswith(".yaml"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to include .yml files?


def _find_image_pull_secrets_values_paths(
self, chart: HelmChartInput, matches: Set[str]
) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is another slightly unusual method that doesn't return anything, nor update an instance variable, so presumably directly updates a variable passed by reference.

If so, I think that should be in the doc string, and possibly in the places that call this method too, as it's really unusual in our code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not convinced this method does anything useful!

It doesn't return anything.
It doesn't set any parameters on the instance (the only instance of self is the recursive call to self._find_image_pull_secrets_values_paths() .

In the end, we just delete imagePullSecrets (because NFM supplies them), and that removal method doesn't worry at all about all this recursive searching. I think this can all be deleted.

@jordlay
Copy link
Collaborator

jordlay commented Mar 11, 2024

This has useful review comments that we should do, not closing this PR until that. Although, the changes are already in main so this will never be completed

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.

3 participants