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

Azure Spring Apps sub-resources #2045

Closed
wants to merge 3 commits into from

Conversation

chutch1122
Copy link
Contributor

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@chutch1122
Copy link
Contributor Author

chutch1122 commented Oct 24, 2022

I think this is ready for review. One thing I did notice is that this repository doesn't seem to have a changelog command in the makefile? (ie: make changelog).

Edit: Got an answer to manually add lines in Slack

@jaxxstorm
Copy link

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@danielrbradley
Copy link
Member

danielrbradley commented Oct 25, 2022

@chutch1122 I've started looking through this. Just need to work through a few more of the details to get it in.

I see the reference links in the description - which part of the docs did you use to infer the default values?

There's been a change to the azure-rest-api-specs submodule: 021e5ab (24th Oct) -> 8d9e220 (20th Oct). I think we want to revert this as this would make us point to an older version. Guessing this might have come in due to rebasing. Can leave this until the last minute as we upgrade versions most nights.

Pending further review:

  • Confirm source of default values
  • Review the new resource version set in the v1-config.yaml
  • Check extreneous changes are removed

@chutch1122
Copy link
Contributor Author

chutch1122 commented Oct 25, 2022

@danielrbradley

I see the reference links in the description - which part of the docs did you use to infer the default values?

I created an Azure Spring Apps instance in Azure and pulled the default values by making API requests manually. I'll write this up in a follow-up comment after lunch.

There's been a change to the azure-rest-api-specs submodule: 021e5ab (24th Oct) -> 8d9e220 (20th Oct). I think we want to revert this as this would make us point to an older version. Guessing this might have come in due to rebasing. Can leave this until the last minute as we upgrade versions most nights.

Sounds good. I remember seeing a change there when rebasing. Any advice on how to safely revert that change? I'm not used to working with git submodules.

@chutch1122
Copy link
Contributor Author

@danielrbradley

Here's a gist with the write-up on the default values: https://gist.github.com/chutch1122/0e925605194a62849d62cbbd0570d1ca

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@danielrbradley
Copy link
Member

Thanks for the gist - that was very helpful 🙇

Here's my summary what I'm currently understanding here, please correct me if I've misunderstood.

  1. Add default mappings for resources which can't be deleted. The properties in the map are then used to set values back to in place of doing a delete.
  2. Add a default version for newly available resources to expose them through the SDK.

I've done a quick rebase for you over here which I think incorporates only the intended changes - feel free to reset your own branch to this commit if the change looks correct to you: https://github.com/pulumi/pulumi-azure-native/compare/azure-spring-apps

Pending questions:

  1. Should we set the default version of BuildServiceAgentPool to the stable 2022-04-01 version - rather than the preview version as this should have longer-term support.
  2. Should appInsightsInstrumentationKey be being set to nil rather than an empty string ""?
  3. There was no configServer properties shown in your configServers gist - should this be nil rather than an empty object or does this not work in practice?
  4. It doesn't appear there's a 'natural default' for the Build Service Agent Pool size - I see you've selected S1 - is it possible to just not select a default and a 'delete' would just not modify this value?

@chutch1122
Copy link
Contributor Author

chutch1122 commented Oct 26, 2022

Understanding check

  1. Add default mappings for resources which can't be deleted. The properties in the map are then used to set values back to in place of doing a delete.

Yes.

  1. Add a default version for newly available resources to expose them through the SDK.

Yes.

Questions

  1. Should we set the default version of BuildServiceAgentPool to the stable 2022-04-01 version - rather than the preview version as this should have longer-term support.

I figured since most of the other resources use the 2022-01-01-preview version that I'd keep it consistent. Maybe it would make sense to upgrade everything together to the latest stable version in a follow-up PR?

  1. Should appInsightsInstrumentationKey be being set to nil rather than an empty string ""?

According to the documentation, null or empty string should both work.

  1. There was no configServer properties shown in your configServers gist - should this be nil rather than an empty object or does this not work in practice?

Both an empty object and null both seem to work when using the "Config Servers - Update Put" endpoint. However, using null instead of an empty object produces the same response from the "Config Servers - Get" endpoint as the original configuration so it's probably "more correct".

Basically it comes down to:

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{asaServiceName}/configServers/default?api-version=2022-09-01-preview

{
	"properties": {
		"provisioningState": "Succeeded"
                "configServer": {} // This property is returned in the response when you PUT an empty object as configServer. It is omitted when you PUT null as configServer
	},
        // ...
}
  1. It doesn't appear there's a 'natural default' for the Build Service Agent Pool size - I see you've selected S1 - is it possible to just not select a default and a 'delete' would just not modify this value?

S1 is the smallest size available for the agent pool so if we can't truly delete it I thought it would be logical to minimize cost. It'd be fine not to modify the value too, of course. I don't have a preference either way.

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@chutch1122
Copy link
Contributor Author

I've reset my branch and updated the config server to be nil

@jaxxstorm
Copy link

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

Happy with all the reasoning and the submodule change now being reverted. This can merge if tests are passing.

"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default": {
"properties": map[string]interface{}{
"traceEnabled": false,
"appInsightsInstrumentationKey": "",
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 required in the defaults as the output type seems to be optional - so I assume this would naturally default to null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They both work according to the documentation but null is probably more correct (similar to the config server). I've made a commit that reflects this change.

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@jaxxstorm
Copy link

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

@chutch1122
Copy link
Contributor Author

Looks like there's an issue with the PR build. It says "error: working tree is not clean, aborting!"

What needs to happen to get this fixed?

@thomas11
Copy link
Contributor

thomas11 commented Oct 27, 2022

Looks like there's an issue with the PR build. It says "error: working tree is not clean, aborting!"

@chutch1122, that typically means that something else has changed in the meantime and the SDK needs to be regenerated. I'll take a look. @viveklak has already done it in #2055.

@phillipedwards
Copy link
Member

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

@viveklak
Copy link
Contributor

viveklak commented Oct 27, 2022

@chutch1122 thanks so much for the PR. I pulled this into #2055 to avoid more churn on the PR (needed to run make clean on the PR to remove files for removed types etc.). That was just released in v1.84.0. Thanks very much for your contribution! I will close this PR.

@viveklak viveklak closed this Oct 27, 2022
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.

None yet

7 participants