Skip to content

Conversation

@shenglol
Copy link
Contributor

@shenglol shenglol commented Apr 2, 2021

Description

Testing Guide
az bicep build/decompile --file {bicep_file}

History Notes
[ARM] BREAKING CHANGE: az bicep build: Change the parameter --files to --file
[ARM] BREAKING CHANGE: az bicep decompile: Change the parameter --files to --file
[ARM] az bicep build: Add a parameter --outdir for specifying the output directory
[ARM] az bicep build: Add a parameter --outfile for specifying the output file path
[ARM] Fix an issue where checking version upgrade for Bicep CLI throws exception if GitHub API rate limit is hit


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

@yonzhan yonzhan added this to the S185 milestone Apr 2, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 2, 2021

ARM

_config_dir = get_config_dir()
_bicep_installation_dir = os.path.join(_config_dir, "bin")
_bicep_version_check_file_path = os.path.join(_config_dir, "bicepVersionCheck.json")
_bicep_version_check_cache_ttl = timedelta(minutes=10)
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask why the ttl of this cache is 10 minutes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting ttl to 10 minutes means it will sent at most 6 requests per hour, which is good enough to avoid GitHub throttling for anonymous requests (60 / hour / IP address). Other other hand, we do want the bicep commands to detect version upgrade of Bicep CLI as soon as we do a release, and I feel like 10 minute of delay is acceptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is still a workaround, though. CI/CD runs that depend on Bicep can still get throttled. We are also thinking about setting up CDN for caching the Bicep releases to completely eliminate the throttling issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks~

@zhoxing-ms
Copy link
Contributor

Changes the --files parameter to --file to only take one file for the az bicep build/decompile commands, because we removed the support of multi-file compiling/decompiling support from Bicep CLI.

I would like to ask why you do not support multiple files any more?

@shenglol
Copy link
Contributor Author

shenglol commented Apr 8, 2021

le files any m

Changes the --files parameter to --file to only take one file for the az bicep build/decompile commands, because we removed the support of multi-file compiling/decompiling support from Bicep CLI.

I would like to ask why you do not support multiple files any more?

Because for bicep build, in some cases it could produce inconsistent/extra JSON templates if one of the files is a module referenced in another file. A build command should only take a main.bicep file and output one JSON template. Decompiling is less of a problem, but we want to keep the user experience consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants