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

[Blueprint] Prevent hidden artifacts parsing #4985

Merged

Conversation

simonkeyd
Copy link
Contributor

@simonkeyd simonkeyd commented Jun 13, 2022

Blueprint extension was parsing all files in the artifacts folder
including hidden Linux files. This unwanted behavior could also raise
errors (eg. UnicodeDecodeError). This commit fixes this by preventing
hidden files from being parsed.

closes #4984


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

Related command

az blueprint import --name generic_blueprint --input-path ./generic_blueprint --management-group deadbeef-dead-beef-8badf00d1337

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?

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.
The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify src/index.json.

@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jun 13, 2022
@ghost
Copy link

ghost commented Jun 13, 2022

Thank you for your contribution simonkeyd! We will review the pull request and get back to you soon.

@ghost
Copy link

ghost commented Jun 13, 2022

CLA assistant check
All CLA requirements met.

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 13, 2022

Blueprint

@yonzhan yonzhan requested review from jsntcy and kairu-ms June 13, 2022 22:39
@yonzhan yonzhan added this to the Jun 2022 (2022-07-05) milestone Jun 13, 2022
@navba-MSFT
Copy link
Contributor

@jsntcy @kairu-ms Could you please review and merge this once you get a chance ? Thanks in advance.

@jsntcy
Copy link
Member

jsntcy commented Jun 23, 2022

@simonkeyd, please take a look at my comments.

Blueprint extension was parsing all files in the artifacts folder
including hidden files. This unwanted behavior can also raise errors
(eg. UnicodeDecodeError). This commit fixes this by preventing hidden
Linux and Windows files from being parsed.

closes Azure#4984
@simonkeyd simonkeyd force-pushed the fix/prevent-blueprint-hidden-files-parsing branch from b99b68e to 5392ed0 Compare June 27, 2022 16:15
@simonkeyd
Copy link
Contributor Author

@jsntcy I amended my commit according to your suggestions. The code is now working for both Windows and Linux platforms. For Linux only it checks for files with a name starting with a dot and for Windows it excludes files with the hidden attribute.

@jsntcy jsntcy requested a review from jiasli June 29, 2022 09:12
@jsntcy jsntcy merged commit 1cce2b6 into Azure:main Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blueprint: Import parses unwanted hidden files
4 participants