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

Allow specifying metadata in bicep in addition to metadata.json #10860

Merged
merged 11 commits into from
Jun 1, 2023

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented May 31, 2023

This is meant to ease the conversion away from metadata.json and to using metadata in the bicep file. It changes:

  1. Picks up metadata in bicep, if present, when generating readme.md
  2. If metadata present in bicep, enforces that it's the same as what's in metadata.json

Right now the metadata.json file is still required, the metadata in bicep is optional (but if present, will get picked up by Bicep for hover).

Technically this checkin isn't necessary for v0.18 because the current brm ignores metadata in the bicep file, but it does help reduce confusion if the bicep metadata and metadata.json are inconsistent.

Microsoft Reviewers: Open in CodeFlow

@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

Test Results (win-x64)

       33 files  ±0         33 suites  ±0   37m 35s ⏱️ + 11m 6s
10 055 tests ±0  10 055 ✔️ ±0  0 💤 ±0  0 ±0 
12 267 runs  ±0  12 267 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 89f662a. ± Comparison against base commit 2c9cd5b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

Test Results (osx-x64)

       33 files  ±0         33 suites  ±0   1h 33m 22s ⏱️ + 9m 28s
10 047 tests ±0  10 047 ✔️ ±0  0 💤 ±0  0 ±0 
12 260 runs  ±0  12 260 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 89f662a. ± Comparison against base commit 2c9cd5b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

Test Results (linux-musl-x64)

       33 files  ±0         33 suites  ±0   30m 20s ⏱️ - 4m 2s
10 043 tests ±0  10 043 ✔️ ±0  0 💤 ±0  0 ±0 
12 256 runs  ±0  12 256 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 89f662a. ± Comparison against base commit 2c9cd5b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

Test Results (linux-x64)

       33 files  ±0         33 suites  ±0   36m 54s ⏱️ + 7m 21s
10 043 tests ±0  10 043 ✔️ ±0  0 💤 ±0  0 ±0 
12 256 runs  ±0  12 256 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 89f662a. ± Comparison against base commit 2c9cd5b.

♻️ This comment has been updated with latest results.

@shenglol
Copy link
Contributor

Can we call context.Console.WriteWarning in GenerateCommand.InvokeInternal to mention that metadata.json will be deprecated in a future release?

@StephenWeatherford
Copy link
Contributor Author

StephenWeatherford commented May 31, 2023

Can we call context.Console.WriteWarning in GenerateCommand.InvokeInternal to mention that metadata.json will be deprecated in a future release?

We can. I'm not positive if it makes sense. With these changes, metadata.json is still required, so there's nothing they can do.

Do you think I should go ahead and make metadata.json optional now? It's more work, including we'd need a new bicep file validator, so I hesitated. I think when metadata.json is optional it makes sense to have the obsolete warning. I was thinking we'd make metadata.json optional in 0.19.0 and then in 0.20.0 or later we could remove support for it.

Thoughts?

Edit: How about what I did in 28ab9b0? That way we only muddy the water if we have added the metadata in bicep for them and they're confused why they're having to update both.

@shenglol
Copy link
Contributor

Can we call context.Console.WriteWarning in GenerateCommand.InvokeInternal to mention that metadata.json will be deprecated in a future release?

We can. I'm not positive if it makes sense. With these changes, metadata.json is still required, so there's nothing they can do.

Do you think I should go ahead and make metadata.json optional now? It's more work, including we'd need a new bicep file validator, so I hesitated. I think when metadata.json is optional it makes sense to have the obsolete warning. I was thinking we'd make metadata.json optional in 0.19.0 and then in 0.20.0 or later we could remove support for it.

Thoughts?

Edit: How about what I did in 28ab9b0? That way we only muddy the water if we have added the metadata in bicep for them and they're confused why they're having to update both.

I think adding the deprecation warning later when metadata.json is optional does make more sense, and the changes in [28ab9b0] is good enough for now.

Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

:shipit:

@StephenWeatherford StephenWeatherford merged commit 7848f47 into main Jun 1, 2023
@StephenWeatherford StephenWeatherford deleted the sw/brm-allow-metadata branch June 1, 2023 00:03
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