Skip to content

MPT-19081 AWS Cost and Usage Reports - WIP#282

Draft
albertsola wants to merge 3 commits intomainfrom
MPT-19081
Draft

MPT-19081 AWS Cost and Usage Reports - WIP#282
albertsola wants to merge 3 commits intomainfrom
MPT-19081

Conversation

@albertsola
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 069321f9-afb5-4fce-afa4-1f12c02db626

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@sonarqubecloud
Copy link

@albertsola albertsola force-pushed the MPT-19081 branch 2 times, most recently from 48ad0bd to 41bcb50 Compare March 20, 2026 11:48
- Reorganise generators into cost_explorer/ and customer_usage_report/
  subpackages; BaseOrganizationUsageGenerator stays in generators/usage.py
- Add CustomerUsageReportGenerator: reads CUR2/BCM Data Exports stored
  as snappy-compressed parquet files in S3, aggregates by account/service/
  record-type and produces OrganizationUsageResult
- Add S3ParquetReportFetcher: lists period-prefixed parquet keys and
  downloads them via AWSClient; billing period encoded as BILLING_PERIOD%3D
- Add AWSClient.list_s3_objects and AWSClient.download_s3_object
- Add pyarrow==19.* dependency
- agreement.py picks generator based on s3BillingExportBucket/Prefix params;
  falls back to CostExplorerUsageGenerator when params are absent
- Both pipelines remain fully operational in parallel

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

� Conflicts:
�	swo_aws_extension/flows/jobs/billing_journal/generators/agreement.py
�	swo_aws_extension/flows/jobs/billing_journal/generators/authorization.py
�	swo_aws_extension/flows/jobs/billing_journal/generators/usage.py
�	tests/flows/jobs/billing_journal/generators/test_agreement.py
�	tests/flows/jobs/billing_journal/generators/test_authorization.py
Move S3 billing export constants to constants.py, remove redundant
config properties, and refactor AgreementJournalGenerator to derive
bucket/prefix from templates at runtime using pm_account_id.

- Bucket template: mpt-billing-{pm_account_id} (filled with PMA)
- Prefix template: cur-{mpa_account_id} (filled with MPA)

Eliminates redundant fulfillment parameters and ensures consistent
S3 naming across all phases. All tests pass: 793 passed, 1 xpassed
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.

1 participant