Skip to content

extensions: Add extensions metadata.yaml#16618

Merged
phlax merged 10 commits intoenvoyproxy:mainfrom
phlax:extensions-metadata-yaml
May 27, 2021
Merged

extensions: Add extensions metadata.yaml#16618
phlax merged 10 commits intoenvoyproxy:mainfrom
phlax:extensions-metadata-yaml

Conversation

@phlax
Copy link
Member

@phlax phlax commented May 21, 2021

Signed-off-by: Ryan Northey ryan@synca.io

Commit Message: extensions: Add extensions metadata.yaml
Additional Description:

This is a breakout pr from #16496 as that will require a lot of change

This PR:

  • adds an extensions_metdata.yaml file
  • uses the new metadata file in protodoc
  • removes generate_extension_db.py
  • adds validate_extension_db.py to
    • ensure that old <> new metadata match
    • consolidate existing metadata validation in one place

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label May 21, 2021
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).

🐱

Caused by: #16618 was opened by phlax.

see: more, trace.

@phlax phlax changed the title extensions: Add extensions metadata.yaml [WIP] extensions: Add extensions metadata.yaml May 21, 2021
@phlax phlax marked this pull request as draft May 21, 2021 16:33
@phlax phlax force-pushed the extensions-metadata-yaml branch from c127c6a to 0e0042b Compare May 21, 2021 18:01
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the extensions-metadata-yaml branch from 04f8c6f to 12bc41e Compare May 21, 2021 18:51
@phlax phlax changed the title [WIP] extensions: Add extensions metadata.yaml extensions: Add extensions metadata.yaml May 21, 2021
@phlax phlax requested a review from htuch May 21, 2021 18:53
@phlax phlax marked this pull request as ready for review May 21, 2021 18:53
@phlax
Copy link
Member Author

phlax commented May 21, 2021

@htuch this is hopefully ready for review

Signed-off-by: Ryan Northey <ryan@synca.io>
# -r docs/requirements.txt
# sphinx
# sphinx-rtd-theme
# sphinx-tabs
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: if you could make changes to docs/requirements.txt in a separate PR, it would make life slightly easier for maintainers downstream.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dmitri-d on this point i would like to push back - adding yaml to the docs build requirements is not needed without this PR - it makes sense to add it here i think

Copy link
Member Author

Choose a reason for hiding this comment

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

the extraneous changes here are produced by pip-compile not sure why they hadnt been set before - but im guessing that dependabot may be to blame for at least the hash ordering

@dmitri-d
Copy link
Contributor

Could you mention how to update metadata in https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md#adding-new-extensions?

@dmitri-d
Copy link
Contributor

looks good, other than a couple of nits above.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Great, thanks, a few comments.
/wait

categories:
- envoy.wasm.runtime
security_posture: unknown
status: alpha
Copy link
Member

Choose a reason for hiding this comment

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

There were a bunch of comments around these status, i.e. that this alpha/unknown status can't change until we do deliberate review and change to threat model, for Wasm runtimes. Can you move these as well to this file? Also pleaes check we haven't missed other places there are similar comments we are missing.

Copy link
Member Author

Choose a reason for hiding this comment

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

this PR hasnt removed the other comments yet - but yep - i will go through and add any comments i can find from the existing metadata registration

Copy link
Member Author

Choose a reason for hiding this comment

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

@htuch i have gone through all of the BUILD files with wasm in the path (and quite a few of the others) and none contain comments

can you point me to any specific examples please ?

Copy link
Member

Choose a reason for hiding this comment

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

# Validate extension metadata

# This script expects a copy of the envoy source to be located at /source
# Alternatively, you can specify a path to the source dir with `ENVOY_SRCDIR`
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 it should default to using $PWD and then in Docker set /source via ENVOY_SRCDIR. The only place we expect to see /source is in Docker.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is very temporary - in the next PR most of this will be gone

Copy link
Member Author

Choose a reason for hiding this comment

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

also - re "$PWD" - this cant do that because its inside the bazel build dir - a path must be passed, there cant be a default that is not hardcoded.

this is one of the reasons for doing this - we wont need the envoy_srcdir to be set at all once this code is trimmed down - the bazel env should have anything that is required

Copy link
Member Author

Choose a reason for hiding this comment

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

also worth mentioning this is just a repurposing of the previous generate_extension_db script - hence the inclusion of the /source default etc

Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to merge this specific part of the PR if it goes in the next one?

Copy link
Member Author

@phlax phlax May 26, 2021

Choose a reason for hiding this comment

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

its just maintaining the equivalence of generate_extension_db - ie ensuring it works in the same circumstances (of being called from docs/build.sh)



if __name__ == '__main__':
sys.exit(validate_extensions())
Copy link
Member

Choose a reason for hiding this comment

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

Does this file need unit tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes - can i do it in the next PR when much of this code will be removed - im more than happy to shift this to a Checker class and add the appropriate tests

}


def compare_old_and_new(old_db, new_db):
Copy link
Member

Choose a reason for hiding this comment

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

Is this just to validate we're doing the right thing as scaffolding? Should it be deleted before merging?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes and no - its to ensure that transitioning from the old macro way of setting the metadata and the new yaml way nothing is lost

Copy link
Member Author

Choose a reason for hiding this comment

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

...and for that reason i think its important to keep it until the macro way has been removed completely

Copy link
Member

Choose a reason for hiding this comment

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

If you want to preserve this over two PRs, then can you mark everything with a comment that will be gone in the next PR, so we don't have to review it with scrutiny?

Copy link
Member Author

Choose a reason for hiding this comment

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

ive added TODOs to all of the soon-to-be-removed code

phlax added 2 commits May 24, 2021 14:40
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax requested a review from htuch May 24, 2021 14:06
@lizan
Copy link
Member

lizan commented May 24, 2021

I'm concerned about this as it is centralizing those metadata into a single file, which means it is harder for downstream builds to define those metadata in the extensions living there. While they won't included in our doc, but it is a good practice anyway. It is also making it harder when we move extensions to contrib/, separating some extensions from standard builds. Thoughts?

@phlax
Copy link
Member Author

phlax commented May 24, 2021

Thoughts?

im very conscious of this - afaia the main downstream is envoy-mobile - so i have done quite a bit of work to figure out what will change and ease the transition

i dont think it will make it harder to separate contrib - but will defo require a slightly different path

phlax added 5 commits May 26, 2021 12:14
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the extensions-metadata-yaml branch from 3efd11d to a69c5df Compare May 26, 2021 14:44
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Let's merge this as is and iterate on next step. Generally prefer to see everything complete before merging, but this will make the larger lift presumably easier with a checkpoint.

@phlax phlax merged commit f481a00 into envoyproxy:main May 27, 2021
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
Signed-off-by: Ryan Northey <ryan@synca.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps Approval required for changes to Envoy's external dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants