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

feat: handle ingest of zipped bundles #491

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

DinoChiesa
Copy link
Collaborator

This modifies the cli to now be able to handle zipped bundles (either proxy or sharedflow) .

Use the same -s switch to pass the source. In the case of a zip, the tool will unzip the bundle to a tmp directory, and then perform the analysis. The tool automatically removes the temp directory after completing the analysis.

One wrinkle:

  • If there are errors or warnings, the tool will report these errors with filenames expressed relative to the zip file, using filenames that are not "real", eg

/usr/local/home/me/apiproxy-20241206-191914.zip/apiproxy/proxies/endpoint1.xml

║ Line     │ Column   │ Type     │ Message                                                │ Rule ID              ║
╟──────────┼──────────┼──────────┼────────────────────────────────────────────────────────┼──────────────────────╢
║ 91       │ 3        │ error    │ Multiple RouteRules with no Condition. Only the        │ PD002                ║
║          │          │          │ first is evaluated.                                    │                      ║

/usr/local/home/me/apiproxy-20241206-191914.zip/apiproxy/policies/SC-Unused.xml

║ Line     │ Column   │ Type     │ Message                                                │ Rule ID              ║
╟──────────┼──────────┼──────────┼────────────────────────────────────────────────────────┼──────────────────────╢
║ 0        │ 0        │ warning  │ SC-Unused is not attached to a Step in the bundle.     │ BN005                ║
║          │          │          │ Remove unused policies.                                │                      ║

There are a bunch of changes in this PR to tests, because of the handling of these relative filenames.

WDYT?

@ssvaidyanathan ssvaidyanathan merged commit 9a06125 into apigee:main Dec 7, 2024
2 checks passed
@DinoChiesa DinoChiesa deleted the handle-zip branch December 7, 2024 00:23
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