8000 [Cloud Directory] added schema endpoints by leslieetubo · Pull Request #8915 · getmoto/moto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Cloud Directory] added schema endpoints #8915

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

Merged
merged 17 commits into from
Jun 7, 2025

Conversation

leslieetubo
Copy link
Contributor
@leslieetubo leslieetubo commented May 21, 2025

Maintainers and Reviewers @bblommers and @bpandola.
This PR adds some endpoints to Cloud Directory Service. To create a cloud directory, a published schema ARN needs to be passed. When a schema is created, it is in the development state, until it is published. Only then can it be applied, during this process, the schema arn changes. see

Hence the flow:

flowchart TD
    A[Create Schema] -->|development| C{what state is schema}
    C -->|development| D[Publish Schema]
    C -->|published| E[Apply Schema]
    C -->|applied| F[Nothing to do]
    D --> B(Create Directory)
Loading

@leslieetubo leslieetubo reopened this May 21, 2025
@leslieetubo leslieetubo marked this pull request as draft May 21, 2025 03:38
Copy link
codecov bot commented May 24, 2025

Codecov Report

Attention: Patch coverage is 91.46341% with 7 lines in your changes missing coverage. Please review.

Project coverage is 92.85%. Comparing base (83e5cbe) to head (2d7742a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
moto/clouddirectory/models.py 88.88% 4 Missing ⚠️
moto/clouddirectory/exceptions.py 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8915      +/-   ##
==========================================
- Coverage   92.85%   92.85%   -0.01%     
==========================================
  Files        1287     1287              
  Lines      112583   112663      +80     
==========================================
+ Hits       104539   104612      +73     
- Misses       8044     8051       +7     
Flag Coverage Δ
servertests 28.57% <19.51%> (-0.01%) ⬇️
unittests 92.82% <91.46%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leslieetubo leslieetubo marked this pull request as ready for review May 27, 2025 21:54
@leslieetubo leslieetubo changed the title Added create schema endpoint Cloud Directory added schema endpoints May 27, 2025
@leslieetubo leslieetubo changed the title Cloud Directory added schema endpoints [Cloud Directory] added schema endpoints May 29, 2025
Copy link
Collaborator
@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

This looks great - thank you for adding support for these endpoints to Moto @leslieetubo!

raise ResourceNotFoundException(schema_arn)
return

@paginate(pagination_model=PAGINATION_MODEL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice to see pagination built-in from the beginning!


non_existent_schema_arn = f"arn:aws:clouddirectory:{region}:{DEFAULT_ACCOUNT_ID}:schema/development/nonexistent"

with pytest.raises(client.exceptions.ResourceNotFoundException):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice to see negative tests as well, having proper error handling helps users a lot during development

@bblommers bblommers added this to the 5.1.6 milestone Jun 7, 2025
@bblommers bblommers merged commit 2da6c33 into getmoto:master Jun 7, 2025
205 of 214 checks passed
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
0