-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Enable source control management as option for user to deploy web apps #826
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @metacpp
Thanks for this PR - I've taken a look through and this mostly looks good to me; it'd be good to expose the value of the Source Control URL, so that folks could use this value without having to go to the Portal first; so can we look into adding that?
Thanks!
@@ -160,6 +162,8 @@ The following arguments are supported: | |||
|
|||
* `websockets_enabled` - (Optional) Should WebSockets be enabled? | |||
|
|||
* `scm_type` - (Optional) The Source Control Management Type. Possible values are `None` and `LocalGit`. Defaults to `None`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest we change this to:
* `scm_type` - (Optional) The type of Source Control enabled for this App Service. Possible values include `None` and `LocalGit`. Defaults to `None`
and add a blue info box below it - stating the other types are coming soon
-> **Note:** Additional Source Control types will be added in the future, once support for them has been added in the Azure SDK for Go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion.
string(web.ScmTypeNone), | ||
string(web.ScmTypeLocalGit), | ||
}, false), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it'd also be good to expose the value of the SCM URL as a computed field - which I believe should be returned from the GetSourceControl
API call when this is set to ScmTypeLocalGit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminding, this is exactly what I did the recent commit, please see changes.
@tombuildsstuff I've updated the PR to include the repo url and branch name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding pending comments which have since been fixed
azurerm/resource_arm_app_service.go
Outdated
|
||
"site_source_control_props": { | ||
Type: schema.TypeList, | ||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given this isn't user-settable - we can remove the Optional
assignment here (Computed is read-only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
azurerm/resource_arm_app_service.go
Outdated
@@ -239,6 +248,23 @@ func resourceArmAppService() *schema.Resource { | |||
Type: schema.TypeString, | |||
Computed: true, | |||
}, | |||
|
|||
"site_source_control_props": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename this source_control
(to match the other fields)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
azurerm/resource_arm_app_service.go
Outdated
|
||
"source_control": { | ||
Type: schema.TypeList, | ||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this Optional
assignment? it's only needed for user specifiable fields (and not readonly ones)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
`source_control` supports the following: | ||
|
||
* `repo_url` - URL of the Git repo. | ||
* `branch` - Branch name of the Git repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we suffix both of these with .. the Git repository for this App Service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @metacpp
Thanks for pushing those latest updates - if we can remove the Optional
field assignment this otherwise looks good to me.
Thanks!
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-%d" | ||
location = "%s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aligning at '='?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
scm_type = "LocalGit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reduce spaces here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
@tombuildsstuff the PR has been updated, please check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I'll kick off the test suite now
@tombuildsstuff Thanks for the reviewing. |
@metacpp given App Service Slots shares the same
I'll push a commit for this today |
the tests reveal this requires a fix to the App Service Slot schema
@tombuildsstuff I reopened this PR coz I worked with App Service team have the LocalGit deployment supported. |
azurerm/resource_arm_app_service.go
Outdated
MaxItems: 1, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"user_name": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd tend to write this as username
- I'll push a commit to make this consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment (which I'll push a commit for) - but this otherwise LGTM 👍
Thanks!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
This PR includes:
TestAccAzureRMAppService