Skip to content

feat(marketplace-agreement): emulate AWS Marketplace Agreement API - #3339

Merged
pgermosen merged 1 commit into
floci-io:mainfrom
KenkoGeek:feat/marketplace-agreement
Sep 10, 2026
Merged

feat(marketplace-agreement): emulate AWS Marketplace Agreement API#3339
pgermosen merged 1 commit into
floci-io:mainfrom
KenkoGeek:feat/marketplace-agreement

Conversation

@KenkoGeek

Copy link
Copy Markdown
Contributor

Summary

Adds AWS Marketplace Agreement API emulation as an independent Marketplace API-family contribution. Includes the JSON protocol handler, agreement lifecycle/search operations, account-aware persistence, integration coverage, docs, and an AWS SDK compatibility smoke test.

This is one of the API-family splits of the previous combined Marketplace contribution (#3303).

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

Reviewed against the current AWS Marketplace Agreement Service API reference. Senior review corrected the SearchAgreements resource filter name to ResourceIdentifier, matching AWS. make docs-check and git diff --check pass. Heavy local Maven execution was intentionally not run on this machine; CI is expected to execute the full test suite.

Checklist

  • ./mvnw test passes locally
  • New or updated integration test added
  • Commit messages follow Conventional Commits

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your first pull request to Floci!

Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR — so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime.

While you wait, a couple of things that make review faster:

  • Link the issue this fixes with Closes #N in the description
  • Commits follow Conventional Commits (feat(s3): ..., fix(dynamodb): ...)
  • Behaviour changes come with a test — see CONTRIBUTING.md

Come join us in Slack — it is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it.

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds AWS Marketplace Agreement API emulation through the shared JSON protocol endpoint.

  • Registers JSON 1.0 Marketplace Agreement routing alongside Marketplace Catalog REST JSON routing.
  • Implements agreement request, lifecycle, search, cancellation, payment, billing adjustment, charge, entitlement, term, and purchase-order operations.
  • Persists agreement state per AWS account and enriches proposal summaries from Marketplace Catalog entities.
  • Adds integration, service, and AWS SDK compatibility coverage plus generated service documentation.

Confidence Score: 5/5

The PR appears safe to merge, with all previous findings resolved and no new actionable issue identified.

Current Agreement list filtering, charge response fields, search ordering, proposal-resource resolution, package structure, and focused tests address the prior review findings. No new failure or repository-rule violation remains in the full PR changes.

Important Files Changed

Filename Overview
src/main/java/io/github/hectorvent/floci/services/marketplace/MarketplaceAgreementService.java Implements account-scoped Marketplace Agreement operations, including the corrections requested by the previous review.
src/main/java/io/github/hectorvent/floci/services/marketplace/MarketplaceJsonHandler.java Dispatches Marketplace Agreement JSON actions through the service-specific controller.
src/main/java/io/github/hectorvent/floci/services/marketplace/MarketplaceAgreementController.java Provides the required thin controller layer for Agreement operations.
src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java Registers both REST JSON and JSON Marketplace protocols with distinct routing signals.
src/test/java/io/github/hectorvent/floci/services/marketplace/MarketplaceAgreementServiceTest.java Covers focused agreement validation, filtering, ordering, resources, and lifecycle behavior.
src/test/java/io/github/hectorvent/floci/services/marketplace/MarketplaceAgreementControllerIntegrationTest.java Verifies Agreement protocol routing and operation behavior through the HTTP layer.

Sequence Diagram

sequenceDiagram
    participant SDK as AWS SDK
    participant JSON as AwsJsonController
    participant Handler as MarketplaceJsonHandler
    participant Controller as MarketplaceAgreementController
    participant Service as MarketplaceAgreementService
    participant Storage as Account-aware Storage

    SDK->>JSON: POST / + X-Amz-Target
    JSON->>Handler: action, body, region
    Handler->>Controller: handle(action, request, region)
    Controller->>Service: handle(action, request, region)
    Service->>Storage: Read or mutate account-scoped records
    Storage-->>Service: Agreement state
    Service-->>SDK: AWS-compatible JSON response
Loading

Reviews (6): Last reviewed commit: "feat(marketplace-agreement): emulate AWS..." | Re-trigger Greptile

@github-actions github-actions Bot added the over-pr-limit Author has more than 5 open PRs — advisory only label Sep 10, 2026
@github-actions

Copy link
Copy Markdown

👋 Thanks for the pull request!

It looks like you now have 10 open pull requests in this repository, which is above our advisory limit of 5. To keep the review backlog focused and make sure every contribution gets proper attention, we ask contributors to shepherd their existing PRs to the finish line before opening new ones — responding to review feedback, rebasing, or closing any that are no longer needed.

Here is your list of open PRs. Nothing is blocked and this PR stays open — this is just a friendly nudge. The over-pr-limit label helps maintainers see at a glance which PRs to prioritize.

If some of these PRs are stacked or intentionally related, just say so here and a maintainer will take that into account.

@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-agreement branch from 264c9fe to 2391e46 Compare September 10, 2026 05:14
@hectorvent hectorvent added enhancement New feature or request marketplace AWS marketplace labels Sep 10, 2026

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work getting this split out cleanly. A few real gaps in SearchAgreements against the documented API: AgreementType is required per AWS's own docs (any combination of the other filters is allowed as long as it's included), but this treats the whole filter list as optional and returns everything when none are given. Your own test calls it with an empty body and expects success, which real AWS would reject.

Several other documented filters, BeforeStartTime, AfterStartTime, BeforeLastUpdateTime, AfterLastUpdateTime, EndTimeBehaviorType, EndTimeBehaviorReasonCode, InitialAgreementId, and LicenseArn, aren't handled at all, so a client filtering on any of them silently gets back zero results instead of the right set or a clear error. ProposerAccountId isn't a real filter either, only AcceptorAccountId is documented. And the sort restriction, StartTime/LastUpdateTime only valid when PartyType is Proposer, isn't enforced.

Separately, this is the first service doc in the recent run that doesn't have a Known deviations section, and there are a couple worth naming: the flat 365-day agreement duration regardless of what's actually in requestedTerms, and the PartyType filter that validates its value but doesn't otherwise change which agreements match.

Also worth rebasing onto current main before the next round.

@pgermosen pgermosen added the waiting-author Review posted; waiting on the PR author to respond label Sep 10, 2026
@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-agreement branch 3 times, most recently from b9e7436 to a58fe65 Compare September 10, 2026 14:31
@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-agreement branch from a58fe65 to b89c265 Compare September 10, 2026 14:51

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All four SearchAgreements gaps from the last round are fixed and confirmed against the docs: AgreementType required, the eight missing filters implemented, ProposerAccountId gone, and the sort-by/PartyType restriction enforced. The Known deviations section now names exactly the two real simplifications. And the descriptor collision with #3338 is resolved cleanly, one combined descriptor carrying both protocols and controllers, matching the sso/ssoadmin pattern already in the file. Approving.

@pgermosen pgermosen removed the waiting-author Review posted; waiting on the PR author to respond label Sep 10, 2026
@pgermosen
pgermosen merged commit c99ecea into floci-io:main Sep 10, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request marketplace AWS marketplace over-pr-limit Author has more than 5 open PRs — advisory only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants