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

feat(idempotency): add idempotency decorator #1723

Merged
merged 4 commits into from
Sep 28, 2023

Conversation

am29d
Copy link
Contributor

@am29d am29d commented Sep 28, 2023

Description of your changes

This PR adds @idempotent decorator to the utility. We initially implemented it, but removed later due to uncertainty about decorator interface with TypeScript 5.x upgrade. Now we can restore and simplify the old implementation, by internally calling makeIdempotent, making it syntactic sugar for this functionality. This also means that most of e2e tests are very similar to the makeIdempotent tests, but we still need to make sure that it works when wrapping around decorator.

Related issues, RFCs

Issue number: closes #1700

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@am29d am29d requested a review from a team as a code owner September 28, 2023 14:16
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation idempotency This item relates to the Idempotency Utility internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) tests PRs that add or change tests labels Sep 28, 2023
@pull-request-size pull-request-size bot added the size/XXL PRs with 1K+ LOC, largely documentation related label Sep 28, 2023
@sonarcloud
Copy link

sonarcloud bot commented Sep 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
22.2% 22.2% Duplication

@github-actions
Copy link
Contributor

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

@github-actions github-actions bot added do-not-merge This item should not be merged need-issue This PR needs an issue before it can be reviewed/worked on further feature PRs that introduce new features or minor changes labels Sep 28, 2023
@am29d am29d requested review from dreamorosi and removed request for a team September 28, 2023 14:18
@am29d am29d self-assigned this Sep 28, 2023
@dreamorosi dreamorosi removed do-not-merge This item should not be merged need-issue This PR needs an issue before it can be reviewed/worked on further labels Sep 28, 2023
@am29d
Copy link
Contributor Author

am29d commented Sep 28, 2023

e2e tests

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Great work on this PR, Alex!

I've left a few comments on the docs only. The general feedback would be to: 1/ let's try to start using import type { fooBar } from '...'; when importing types. This helps with telling TS what we are importing.

docs/utilities/idempotency.md Show resolved Hide resolved
docs/utilities/idempotency.md Show resolved Hide resolved
packages/idempotency/README.md Show resolved Hide resolved
packages/idempotency/README.md Show resolved Hide resolved
packages/idempotency/README.md Show resolved Hide resolved
packages/idempotency/README.md Show resolved Hide resolved
packages/idempotency/README.md Show resolved Hide resolved
@dreamorosi
Copy link
Contributor

dreamorosi commented Sep 28, 2023

Thanks for running the integration tests, they are passing 🎉

@am29d am29d merged commit d138673 into main Sep 28, 2023
13 checks passed
@am29d am29d deleted the 1700-add-idempotency-decorator branch September 28, 2023 15:11
dreamorosi added a commit that referenced this pull request Sep 28, 2023
@am29d am29d mentioned this pull request Sep 28, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature PRs that introduce new features or minor changes idempotency This item relates to the Idempotency Utility internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) size/XXL PRs with 1K+ LOC, largely documentation related tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add back Idempotent decorators
2 participants