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

refactor(project|billing_group): replaced client-v2 with avngen #2034

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vmyroslav
Copy link
Contributor

About this change—what it does

  • replaced client-v2 with avngen in project and billing_group resources

@vmyroslav vmyroslav requested a review from a team as a code owner February 5, 2025 19:10
@vmyroslav vmyroslav added the no changelog No changelog entries are required for this PR label Feb 5, 2025
@vmyroslav vmyroslav force-pushed the vmyroslav-project-avngen branch from eee5905 to 641c5be Compare February 5, 2025 19:18
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
//DiffSuppressFunc: schemautil.EmptyObjectNoChangeDiffSuppressFunc,
Copy link
Contributor

Choose a reason for hiding this comment

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

Either it must be computed, or we should clearly log this change in the changelog, telling we have fixed this.

Description: "Address lines 1 and 2. For example, street, PO box, or building.",
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. If it is not computed, it would show the plan.

return billinggroup.BillingCurrencyType(v.(string))
}
return ""
}(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Get always returns something. Either the real or zero value.

Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "name", fmt.Sprintf("test-acc-bg-%s", rName)),
resource.TestCheckResourceAttr(resourceName, "billing_emails.#", "0"),
resource.TestCheckResourceAttr(resourceName, "address_lines.#", "0"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Good job!

db, err := c.BillingGroup.Get(ctx, rs.Primary.ID)
var e aiven.Error
bg, err := c.BillingGroupGet(ctx, rs.Primary.ID)
var e avngen.Error
if common.IsCritical(err) && errors.As(err, &e) && e.Status != 500 {
return fmt.Errorf("error getting a billing group by id: %w", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This error message doesn't make sense. 500 is a clearly an error.

if cardID == "" {
return nil, nil
}

card, err := client.CardsHandler.Get(ctx, cardID)
cards, err := client.UserCreditCardsList(ctx) //nolint:staticcheck
Copy link
Contributor

@byashimov byashimov Feb 10, 2025

Choose a reason for hiding this comment

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

Why do we skip linting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog No changelog entries are required for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants