Skip to content

Commit 71d9f5d

Browse files
committed
fix: lint errors
1 parent fa602a4 commit 71d9f5d

File tree

7 files changed

+32
-10
lines changed

7 files changed

+32
-10
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ name: Tests
55
# Optionally, you can turn it on using a schedule for regular testing.
66
on:
77
pull_request:
8+
branches:
9+
- main
810
paths-ignore:
911
- "README.md"
1012
push:
13+
branches:
14+
- main
1115
paths-ignore:
1216
- "README.md"
1317
# We test at a regular interval to ensure we are alerted to something breaking due
File renamed without changes.

internal/provider/resource_organization_repository_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func TestAccOrganizationRepositoryResource_GitHub(t *testing.T) {
9898
t.Skip("Skipping test due to missing SENTRY_TEST_GITHUB_REPOSITORY_IDENTIFIER environment variable")
9999
}
100100

101-
testAccOrganizationRepositoryResourcePreCheck()
101+
must.Do(testAccOrganizationRepositoryResourcePreCheck())
102102
},
103103
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
104104
Steps: []resource.TestStep{
@@ -150,7 +150,7 @@ func TestAccOrganizationRepositoryResource_GitLab(t *testing.T) {
150150
t.Skip("Skipping test due to missing SENTRY_TEST_GITLAB_REPOSITORY_IDENTIFIER environment variable")
151151
}
152152

153-
testAccOrganizationRepositoryResourcePreCheck()
153+
must.Do(testAccOrganizationRepositoryResourcePreCheck())
154154
},
155155
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
156156
Steps: []resource.TestStep{
@@ -202,7 +202,7 @@ func TestAccOrganizationRepositoryResource_VSTS(t *testing.T) {
202202
t.Skip("Skipping test due to missing SENTRY_TEST_VSTS_REPOSITORY_IDENTIFIER environment variable")
203203
}
204204

205-
testAccOrganizationRepositoryResourcePreCheck()
205+
must.Do(testAccOrganizationRepositoryResourcePreCheck())
206206
},
207207
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
208208
Steps: []resource.TestStep{

internal/provider/resource_project.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ func (m *ProjectResourceModel) Fill(project apiclient.Project) error {
124124
m.ResolveAge = types.Int64Value(project.ResolveAge)
125125

126126
if m.Filters != nil {
127-
m.Filters.Fill(project)
127+
if err := m.Filters.Fill(project); err != nil {
128+
return err
129+
}
128130
}
129131

130132
m.FingerprintingRules = sentrytypes.TrimmedStringValue(project.FingerprintingRules)

sentry/resource_sentry_organization_code_mappings.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ func resourceSentryOrganizationCodeMappingCreate(ctx context.Context, d *schema.
9393
}
9494

9595
d.SetId(orgCodeMapping.ID)
96-
d.Set("internal_id", orgCodeMapping.ID)
96+
if err := d.Set("internal_id", orgCodeMapping.ID); err != nil {
97+
return diag.FromErr(err)
98+
}
9799
return resourceSentryOrganizationCodeMappingRead(ctx, d, meta)
98100
}
99101

@@ -178,7 +180,9 @@ func resourceSentryOrganizationCodeMappingUpdate(ctx context.Context, d *schema.
178180
}
179181

180182
d.SetId(orgCodeMapping.ID)
181-
d.Set("internal_id", orgCodeMapping.ID)
183+
if err := d.Set("internal_id", orgCodeMapping.ID); err != nil {
184+
return diag.FromErr(err)
185+
}
182186

183187
return resourceSentryOrganizationCodeMappingRead(ctx, d, meta)
184188
}
@@ -204,7 +208,9 @@ func importSentryOrganizationCodeMapping(ctx context.Context, d *schema.Resource
204208
}
205209

206210
d.SetId(id)
207-
d.Set("organization", org)
211+
if err := d.Set("organization", org); err != nil {
212+
return nil, err
213+
}
208214

209215
resourceSentryOrganizationCodeMappingRead(ctx, d, meta)
210216

sentry/resource_sentry_organization_member.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ func resourceSentryOrganizationMemberRead(ctx context.Context, d *schema.Resourc
9696
client := meta.(*providerdata.ProviderData).Client
9797

9898
org, memberID, err := splitSentryOrganizationMemberID(d.Id())
99+
if err != nil {
100+
return diag.FromErr(err)
101+
}
99102

100103
tflog.Debug(ctx, "Reading organization member", map[string]interface{}{
101104
"org": org,

sentry/resource_sentry_organization_repository_github.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ func resourceSentryOrganizationRepositoryGithubCreate(ctx context.Context, d *sc
8686
// You can connect multiple GitHub organizations to one Sentry organization, but you cannot connect a single GitHub organization to multiple Sentry organizations.
8787
// https://docs.sentry.io/product/integrations/source-code-mgmt/github/
8888
d.SetId(identifier)
89-
d.Set("internal_id", orgRepo.ID)
89+
if err := d.Set("internal_id", orgRepo.ID); err != nil {
90+
return diag.FromErr(err)
91+
}
9092

9193
return resourceSentryOrganizationRepositoryGithubRead(ctx, d, meta)
9294
}
@@ -172,8 +174,13 @@ func importSentryOrganizationRepositoryGithub(ctx context.Context, d *schema.Res
172174
}
173175

174176
d.SetId(id)
175-
d.Set("identifier", id)
176-
d.Set("organization", org)
177+
if err := d.Set("identifier", id); err != nil {
178+
return nil, err
179+
}
180+
181+
if err := d.Set("organization", org); err != nil {
182+
return nil, err
183+
}
177184

178185
resourceSentryOrganizationRepositoryGithubRead(ctx, d, meta)
179186

0 commit comments

Comments
 (0)