-
Notifications
You must be signed in to change notification settings - Fork 123
[ISSUE-154] Add Watches #155
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
154 commits
Select commit
Hold shift + click to select a range
bfc26ee
add watcher - need to test
RobsonSutton e8150bd
rebasing
RobsonSutton d8f2a01
rebasing
RobsonSutton 1c07e79
generate docs
RobsonSutton ceca05a
fmt
RobsonSutton 73f3660
regenerate docs
RobsonSutton 4ad9784
update errors
RobsonSutton a9ba3e0
docs-generate
RobsonSutton 91cf1d7
update to work with new package structure
RobsonSutton 89bd9b9
test enabling xpack watcher
RobsonSutton 7f445aa
missed license
RobsonSutton 41c1076
test updating xpack license value
RobsonSutton 2a32701
rebase
RobsonSutton 713e7e1
testing
RobsonSutton ac1c6f2
tidy files
RobsonSutton 1bd809e
missed full stop
RobsonSutton 8eb28cf
revert container memory settings
RobsonSutton 60f66d8
update PUT approach
RobsonSutton b0d35bb
marshal entire object
RobsonSutton bd744a2
testing
RobsonSutton 2ced4e8
testing
RobsonSutton cef2fd3
testing
RobsonSutton ec2c0dc
testing
RobsonSutton 948aff5
teting
RobsonSutton 60ba98e
testing
RobsonSutton d7da805
testing
RobsonSutton faeacf1
testing
RobsonSutton 4e1b23f
testing
RobsonSutton a6631d9
testing
RobsonSutton 241c5b6
testing
RobsonSutton 2085c1f
testing
RobsonSutton fa991b8
remove comment
RobsonSutton e7ab2ee
unflatten active
RobsonSutton e303b44
testing
RobsonSutton 33b3603
nest structs
RobsonSutton 7848801
testing
RobsonSutton ebf101a
testing
RobsonSutton 867eb90
testing
RobsonSutton ac6e973
testing
RobsonSutton b0279c2
testing
RobsonSutton 5090822
testing
RobsonSutton 3a510c1
testing
RobsonSutton ab5f1b0
testing
RobsonSutton 7b18d2f
silly mistake while testing
RobsonSutton f3c6c6a
Correctly handle the GET watch API response
tobio e4759ec
testing
RobsonSutton 5657768
revert local to match remote
RobsonSutton 5823e5d
testing defining empty defaults for nested json
RobsonSutton c92b9ad
testing
RobsonSutton 584515d
testing previous approach
RobsonSutton ad53bf8
testing
RobsonSutton 6dab80d
testing
RobsonSutton fd70883
testing
RobsonSutton a72d02c
testing
RobsonSutton c06059d
testing
RobsonSutton 8ef4617
testing
RobsonSutton 9ea259e
testing
RobsonSutton e4092c0
testing
RobsonSutton 8e0956f
testing
RobsonSutton c316cda
testing
RobsonSutton b635b83
revert
RobsonSutton 4b70d63
testing
RobsonSutton a76baf5
testing
RobsonSutton a58134d
testing
RobsonSutton 47be70f
testing
RobsonSutton 48a280b
testing
RobsonSutton 89482ef
testing
RobsonSutton 0196f79
testing defaults
RobsonSutton cd00dbe
testing
RobsonSutton fb54383
testing
RobsonSutton e0708f6
revert testing
RobsonSutton 51bef53
testing
RobsonSutton d8c502e
testing
RobsonSutton 5a51fbc
testing
RobsonSutton 25a3a85
update types
RobsonSutton feefbdd
testing
RobsonSutton df7caa5
testing
RobsonSutton 0cdebd3
testing
RobsonSutton 7b0ac27
testing
RobsonSutton bec3449
testing
RobsonSutton 8f4bc92
testing
RobsonSutton 5e45140
testing
RobsonSutton 6b19e9d
testing
RobsonSutton 120aed6
testing
RobsonSutton a8ae03f
testing
RobsonSutton a29d891
testing
RobsonSutton e1fd04b
testing
RobsonSutton 76f4db6
testing
RobsonSutton c6087e1
testing
RobsonSutton 04f711c
testing
RobsonSutton c04098e
testing
RobsonSutton 543eb89
testing
RobsonSutton 7a722b9
testing
RobsonSutton ed4f369
testing
RobsonSutton 7721c4e
testing
RobsonSutton 8eccf1e
testing
RobsonSutton 07f5500
testing
RobsonSutton 3743937
testing
RobsonSutton 04887fe
testing
RobsonSutton 5dba763
testing
RobsonSutton 6ba0da1
testing
RobsonSutton 5254fd8
testing
RobsonSutton 9ac8513
testing
RobsonSutton ea06802
testing
RobsonSutton 979a728
testing
RobsonSutton 426cb27
testing
RobsonSutton c20dff4
testing
RobsonSutton 6a9e5e3
testing
RobsonSutton ef85cd2
testing
RobsonSutton a308fc7
testing
RobsonSutton 775fdd0
testing
RobsonSutton 3e499b0
testing
RobsonSutton 7b84eaf
testing
RobsonSutton c5851dd
testing
RobsonSutton 6cfe418
testing
RobsonSutton 39a8f85
testing
RobsonSutton f9030ea
testing
RobsonSutton c588fc5
testing
RobsonSutton 4f8aab7
testing
RobsonSutton 8848d03
testing
RobsonSutton da24fc3
testing
RobsonSutton dcc32a5
testing
RobsonSutton 225b78a
testing
RobsonSutton 3a9fd44
tidy up
RobsonSutton 0ec2c46
update tests
RobsonSutton b5c146c
reorder struct
RobsonSutton b04555d
blasted space...
RobsonSutton d7ab40d
update check
RobsonSutton f9596b2
try again
RobsonSutton 0354071
testing
RobsonSutton c989089
testing
RobsonSutton 142c0fc
Merge branch 'elastic:main' into issue-154
RobsonSutton 849e10f
validate omitempty on metadata field
RobsonSutton acd06cf
remove error
RobsonSutton d64297b
fmt
RobsonSutton 21f0c1d
fmt
RobsonSutton f6e2552
update docs
RobsonSutton 3bc46ec
generate docs
RobsonSutton e61aae1
remove testing tf files
RobsonSutton ac229cc
remove connection schema
RobsonSutton f77042c
update docs
RobsonSutton b4e9bcf
add models.PutWatch
RobsonSutton 88c2a26
rename resource to elasticstack_elasticsearch_watch
RobsonSutton ecf4c2b
update approach to use individual fields
RobsonSutton a8291ce
gen docs
RobsonSutton 36858d7
gen docs
RobsonSutton 27bc1f7
marshal into individual fields
RobsonSutton 38a7f74
restructure body to individual fields
RobsonSutton a15b494
missed some renaming
RobsonSutton d861e6b
fix missing braces in watcher_test
RobsonSutton f7770cb
match test to default from API
RobsonSutton 47347b9
Merge branch 'main' into issue-154
RobsonSutton e8004d5
fmt
RobsonSutton e3b4407
update CHANGELOG.md
RobsonSutton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| --- | ||
| subcategory: "Watcher" | ||
| layout: "" | ||
| page_title: "Elasticstack: elasticstack_elasticsearch_watcher_watch Resource" | ||
| description: |- | ||
| Adds and manages a Watch. | ||
| --- | ||
|
|
||
| # Resource: elasticstack_elasticsearch_watcher_watch | ||
|
|
||
| Adds and manages a Watch. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api.html | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| provider "elasticstack" { | ||
| elasticsearch {} | ||
| } | ||
|
|
||
| resource "elasticstack_elasticsearch_watcher_watch" "example" { | ||
| watch_id = "test_watch" | ||
| active = true | ||
|
|
||
| body = jsonencode({ | ||
| "trigger" = { | ||
| "schedule" = { | ||
| "daily" = { | ||
| "at" = "noon" | ||
| } | ||
| } | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| output "watch" { | ||
| value = elasticstack_elasticsearch_watcher_watch.example.watch_id | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `body` (String) Configuration for the pipeline. | ||
| - `watch_id` (String) Identifier for the watch. | ||
|
|
||
| ### Optional | ||
|
|
||
| - `active` (Boolean) Defines whether the watch is active or inactive by default. The default value is true, which means the watch is active by default. | ||
| - `elasticsearch_connection` (Block List, Max: 1, Deprecated) Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead. (see [below for nested schema](#nestedblock--elasticsearch_connection)) | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `id` (String) Internal identifier of the resource | ||
|
|
||
| <a id="nestedblock--elasticsearch_connection"></a> | ||
| ### Nested Schema for `elasticsearch_connection` | ||
|
|
||
| Optional: | ||
|
|
||
| - `api_key` (String, Sensitive) API Key to use for authentication to Elasticsearch | ||
| - `ca_data` (String) PEM-encoded custom Certificate Authority certificate | ||
| - `ca_file` (String) Path to a custom Certificate Authority certificate | ||
| - `cert_data` (String) PEM encoded certificate for client auth | ||
| - `cert_file` (String) Path to a file containing the PEM encoded certificate for client auth | ||
| - `endpoints` (List of String, Sensitive) A list of endpoints where the terraform provider will point to, this must include the http(s) schema and port number. | ||
| - `insecure` (Boolean) Disable TLS certificate validation | ||
| - `key_data` (String, Sensitive) PEM encoded private key for client auth | ||
| - `key_file` (String) Path to a file containing the PEM encoded private key for client auth | ||
| - `password` (String, Sensitive) Password to use for API authentication to Elasticsearch. | ||
| - `username` (String) Username to use for API authentication to Elasticsearch. | ||
|
|
||
| ## Import | ||
|
|
||
| Import is supported using the following syntax: | ||
|
|
||
| ```shell | ||
| terraform import elasticstack_elasticsearch_watcher_watch.watch_id <cluster_uuid>/<watch ID> | ||
| ``` |
2 changes: 1 addition & 1 deletion
2
examples/resources/elasticstack_elasticsearch_logstash_pipeline/import.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| terraform import elasticstack_elasticsearch_security_logstash_pipeline.my_pipeline <cluster_uuid>/<pipeline ID> | ||
| terraform import elasticstack_elasticsearch_logstash_pipeline.my_pipeline <cluster_uuid>/<pipeline ID> |
1 change: 1 addition & 0 deletions
1
examples/resources/elasticstack_elasticsearch_watcher_watch/import.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| terraform import elasticstack_elasticsearch_watcher_watch.watch_id <cluster_uuid>/<watch ID> |
22 changes: 22 additions & 0 deletions
22
examples/resources/elasticstack_elasticsearch_watcher_watch/resource.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| provider "elasticstack" { | ||
| elasticsearch {} | ||
| } | ||
|
|
||
| resource "elasticstack_elasticsearch_watcher_watch" "example" { | ||
| watch_id = "test_watch" | ||
| active = true | ||
|
|
||
| body = jsonencode({ | ||
| "trigger" = { | ||
| "schedule" = { | ||
| "daily" = { | ||
| "at" = "noon" | ||
| } | ||
| } | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| output "watch" { | ||
| value = elasticstack_elasticsearch_watcher_watch.example.watch_id | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| package elasticsearch | ||
|
|
||
| import ( | ||
| "bytes" | ||
| "context" | ||
| "encoding/json" | ||
| "fmt" | ||
| "net/http" | ||
|
|
||
| "github.com/elastic/terraform-provider-elasticstack/internal/clients" | ||
| "github.com/elastic/terraform-provider-elasticstack/internal/models" | ||
| "github.com/elastic/terraform-provider-elasticstack/internal/utils" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/diag" | ||
| ) | ||
|
|
||
| func PutWatch(ctx context.Context, apiClient *clients.ApiClient, watch *models.Watch) diag.Diagnostics { | ||
| var diags diag.Diagnostics | ||
|
|
||
| esClient, err := apiClient.GetESClient() | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
|
|
||
| watchBytes, err := json.Marshal(watch.Body) | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
|
|
||
| body := esClient.Watcher.PutWatch.WithBody(bytes.NewReader(watchBytes)) | ||
|
|
||
| res, err := esClient.Watcher.PutWatch(watch.WatchID, body, esClient.Watcher.PutWatch.WithContext(ctx)) | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| defer res.Body.Close() | ||
| if diags := utils.CheckError(res, "Unable to create or update watch"); diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| if watch.Active { | ||
| _, err := esClient.Watcher.ActivateWatch(watch.WatchID) | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| } else { | ||
| _, err := esClient.Watcher.DeactivateWatch(watch.WatchID) | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| } | ||
|
|
||
| return diags | ||
| } | ||
|
|
||
| func GetWatch(ctx context.Context, apiClient *clients.ApiClient, watchID string) (*models.Watch, diag.Diagnostics) { | ||
| var diags diag.Diagnostics | ||
|
|
||
| esClient, err := apiClient.GetESClient() | ||
| if err != nil { | ||
| return nil, diag.FromErr(err) | ||
| } | ||
|
|
||
| res, err := esClient.Watcher.GetWatch(watchID, esClient.Watcher.GetWatch.WithContext(ctx)) | ||
| if err != nil { | ||
| return nil, diag.FromErr(err) | ||
| } | ||
| defer res.Body.Close() | ||
| if res.StatusCode == http.StatusNotFound { | ||
| return nil, nil | ||
| } | ||
| if diags := utils.CheckError(res, "Unable to find watch on cluster."); diags.HasError() { | ||
| return nil, diags | ||
| } | ||
|
|
||
| watch := make(map[string]models.Watch) | ||
| watchBody := make(map[string]interface{}) | ||
| if err := json.NewDecoder(res.Body).Decode(&watchBody); err != nil { | ||
| return nil, diag.FromErr(err) | ||
| } | ||
|
|
||
| if watch, ok := watch[watchID]; ok { | ||
| watch.WatchID = watchID | ||
| watch.Body = watchBody | ||
| return &watch, diags | ||
| } | ||
|
|
||
| diags = append(diags, diag.Diagnostic{ | ||
| Severity: diag.Error, | ||
| Summary: "Unable to find watch in the cluster", | ||
| Detail: fmt.Sprintf(`Unable to find "%s" watch in the cluster`, watchID), | ||
| }) | ||
| return nil, diags | ||
| } | ||
|
|
||
| func DeleteWatch(ctx context.Context, apiClient *clients.ApiClient, watchID string) diag.Diagnostics { | ||
| var diags diag.Diagnostics | ||
| esClient, err := apiClient.GetESClient() | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| res, err := esClient.Watcher.DeleteWatch(watchID, esClient.Watcher.DeleteWatch.WithContext(ctx)) | ||
|
|
||
| if err != nil && res.IsError() { | ||
| return diag.FromErr(err) | ||
| } | ||
| defer res.Body.Close() | ||
| if diags := utils.CheckError(res, "Unable to delete watch"); diags.HasError() { | ||
| return diags | ||
| } | ||
| return diags | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| package watcher | ||
|
|
||
| import ( | ||
| "context" | ||
| "encoding/json" | ||
| "fmt" | ||
|
|
||
| "github.com/elastic/terraform-provider-elasticstack/internal/clients" | ||
| "github.com/elastic/terraform-provider-elasticstack/internal/clients/elasticsearch" | ||
| "github.com/elastic/terraform-provider-elasticstack/internal/models" | ||
| "github.com/elastic/terraform-provider-elasticstack/internal/utils" | ||
| "github.com/hashicorp/terraform-plugin-log/tflog" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/diag" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
| "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" | ||
| ) | ||
|
|
||
| func ResourceWatch() *schema.Resource { | ||
| watchSchema := map[string]*schema.Schema{ | ||
| "id": { | ||
| Description: "Internal identifier of the resource", | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| }, | ||
| "watch_id": { | ||
| Description: "Identifier for the watch.", | ||
| Type: schema.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| }, | ||
| "active": { | ||
| Description: "Defines whether the watch is active or inactive by default. The default value is true, which means the watch is active by default.", | ||
| Type: schema.TypeBool, | ||
| Optional: true, | ||
| Default: true, | ||
| }, | ||
| "body": { | ||
| Description: "Configuration for the pipeline.", | ||
| Type: schema.TypeString, | ||
| ValidateFunc: validation.StringIsJSON, | ||
| DiffSuppressFunc: utils.DiffJsonSuppress, | ||
| Required: true, | ||
| }, | ||
| } | ||
|
|
||
| utils.AddConnectionSchema(watchSchema) | ||
RobsonSutton marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return &schema.Resource{ | ||
| Description: "Manage Watches. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api.html", | ||
|
|
||
| CreateContext: resourceWatchPut, | ||
| UpdateContext: resourceWatchPut, | ||
| ReadContext: resourceWatchRead, | ||
| DeleteContext: resourceWatchDelete, | ||
|
|
||
| Importer: &schema.ResourceImporter{ | ||
| StateContext: schema.ImportStatePassthroughContext, | ||
| }, | ||
|
|
||
| Schema: watchSchema, | ||
| } | ||
| } | ||
|
|
||
| func resourceWatchPut(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
| client, diags := clients.NewApiClient(d, meta) | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| watchID := d.Get("watch_id").(string) | ||
| id, diags := client.ID(ctx, watchID) | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| var watchBody map[string]interface{} | ||
| if err := json.Unmarshal([]byte(d.Get("body").(string)), &watchBody); err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
|
|
||
| watch := models.Watch{ | ||
| WatchID: watchID, | ||
| Active: d.Get("active").(bool), | ||
| Body: watchBody, | ||
| } | ||
|
|
||
| if diags := elasticsearch.PutWatch(ctx, client, &watch); diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| d.SetId(id.String()) | ||
| return resourceWatchRead(ctx, d, meta) | ||
| } | ||
|
|
||
| func resourceWatchRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
| client, diags := clients.NewApiClient(d, meta) | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
| resourceID, diags := clients.ResourceIDFromStr(d.Id()) | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| watch, diags := elasticsearch.GetWatch(ctx, client, resourceID) | ||
| if watch == nil && diags == nil { | ||
| tflog.Warn(ctx, fmt.Sprintf(`Watch "%s" not found, removing from state`, resourceID)) | ||
| d.SetId("") | ||
| return diags | ||
| } | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| if err := d.Set("watch_id", watch.WatchID); err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| if err := d.Set("active", watch.Active); err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| body, err := json.Marshal(watch.Body) | ||
| if err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
| if err := d.Set("body", string(body)); err != nil { | ||
| return diag.FromErr(err) | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func resourceWatchDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
| client, diags := clients.NewApiClient(d, meta) | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
| resourceID, diags := clients.ResourceIDFromStr(d.Id()) | ||
| if diags.HasError() { | ||
| return diags | ||
| } | ||
|
|
||
| if diags := elasticsearch.DeleteWatch(ctx, client, resourceID); diags.HasError() { | ||
| return diags | ||
| } | ||
| return nil | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.