Skip to content

Conversation

@jicelhay
Copy link
Collaborator

@jicelhay jicelhay commented Apr 22, 2025

The desired outcome from this changes are:

  • The invoicing file will group/count invoice rows ignoring the registrarId field. Right now registrarId is a field in InvoiceGroupingKey, which is used to generate invoice file rows. With this change we're not setting registrarId but keeping ProductAccountKey, which will result in billing events that have = product account key (and rest of fields in a InvoiceGroupingKey) but != registrarId to be groupped under the same row in the invoice file.
  • The detailed reports saved in Google Drive will still be created separately, one per accreditation. They might have different filenames from before - that's not a problem.

b/410593421


This change is Reviewable

@jicelhay jicelhay requested a review from CydeWeys April 22, 2025 19:14
Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

The PR descriptions mentions Sav explicitly, but this will change the billing behavior for all multi-accreditation registrars (of which we have many), right?

Reviewable status: 0 of 2 files reviewed, all discussions resolved

Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

Also, in the absence of the registrar ID, what are we grouping on? Just the billing ID? So the billing ID would have to be the same across the various accreditations for a registrar for this to group correctly?

Reviewable status: 0 of 2 files reviewed, all discussions resolved

Copy link
Collaborator Author

@jicelhay jicelhay left a comment

Choose a reason for hiding this comment

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

Yes, it changes the rows of the invoice CSV file which is a single file: it removes the value of one column and because of that the grouping/end result of the file is different.

If you look at the GenerateInvoiceRows.expand method, it maps strings to InvoiceGroupingKeys and then counts/groups identical occurrences. It wasn't explicitly grouping on registrarId, but on the whole row. Once removed it will still group on InvoiceGroupingKey, so for this case = ProductAccountKey and !=registrarId will now group these rows together.

Reviewable status: 0 of 2 files reviewed, all discussions resolved

Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

Can you amend the commit description to explain details of how grouping is handled after this commit, and omit specific mention of Sav seeing as how this change affects all multi-accreditation registrars?

Reviewable status: 0 of 2 files reviewed, all discussions resolved

Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion


core/src/main/java/google/registry/beam/billing/BillingEvent.java line 175 at r1 (raw file):

                .toString(),
        billingId(),
        "",

Does null make more sense here vs empty string?

Copy link
Collaborator Author

@jicelhay jicelhay left a comment

Choose a reason for hiding this comment

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

Description updated.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @CydeWeys)


core/src/main/java/google/registry/beam/billing/BillingEvent.java line 175 at r1 (raw file):

Previously, CydeWeys (Ben McIlwain) wrote…

Does null make more sense here vs empty string?

I put "" because the invoicing pipeline sets "" on other fields that are not present (see poNumber) so I assumed it's the way the team prefered to handle non present values. I don't have a strong preference.

I think the most correct solution would be to remove registrar id from the key/string row and remove the header from the csv file, but I don't want to change the code too much.

Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 2 files reviewed, all discussions resolved

@jicelhay jicelhay enabled auto-merge May 1, 2025 18:08
@jicelhay jicelhay added this pull request to the merge queue May 13, 2025
Merged via the queue into google:master with commit bd30fcc May 13, 2025
8 of 9 checks passed
@jicelhay jicelhay deleted the invoicepipelinekey branch May 13, 2025 21:23
qrtp pushed a commit to unstoppabledomains/nomulus that referenced this pull request Jun 27, 2025
* Remove registrar id from invoice grouping key

* Fix formatting issues

* Update BillingEventTests
qrtp pushed a commit to unstoppabledomains/nomulus that referenced this pull request Jun 27, 2025
* Remove registrar id from invoice grouping key

* Fix formatting issues

* Update BillingEventTests
qrtp pushed a commit to unstoppabledomains/nomulus that referenced this pull request Jun 27, 2025
* Remove registrar id from invoice grouping key

* Fix formatting issues

* Update BillingEventTests
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.

2 participants