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

Add conjure endpoint errors #1670

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Add conjure endpoint errors #1670

wants to merge 10 commits into from

Conversation

mpritham
Copy link
Contributor

@mpritham mpritham commented Oct 29, 2024

Before this PR

Expand the Conjure specification to support specifying errors that can be thrown on each endpoint.

After this PR

==COMMIT_MSG==
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Oct 29, 2024

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

wip: Add conjure endpoint errors

Check the box to generate changelog(s)

  • Generate changelog entry

@mpritham mpritham marked this pull request as ready for review October 30, 2024 19:05
@mpritham mpritham changed the title wip: Add conjure endpoint errors Add conjure endpoint errors Oct 30, 2024
@mpritham mpritham marked this pull request as draft October 30, 2024 19:10
@mpritham
Copy link
Contributor Author

mpritham commented Oct 30, 2024

Back to draft, realized I didn't update the documentation.

conjure.schema.json Outdated Show resolved Hide resolved
@mpritham mpritham marked this pull request as ready for review October 31, 2024 16:00
@mpritham mpritham force-pushed the pm/endpoint-error-update branch 3 times, most recently from 7c06435 to 2c1f0ce Compare October 31, 2024 16:26
@mpritham mpritham requested a review from bjlaub October 31, 2024 18:06
@mpritham mpritham marked this pull request as draft October 31, 2024 18:07
carterkozak
carterkozak previously approved these changes Oct 31, 2024
Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

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

Let's cut an rc, nice work!

@policy-bot policy-bot bot dismissed carterkozak’s stale review October 31, 2024 19:48

Invalidated by push of 853ff93

docs: optional<Documentation>
deprecated: optional<Documentation>
markers: list<Type>
tags: set<string>
EndpointName:
alias: string
docs: Should be in lowerCamelCase.
EndpointError:
fields:
error: TypeName
Copy link
Contributor

Choose a reason for hiding this comment

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

I think TypeName may be a bit misleading here, there's a fair bit of overlap, but I think perhaps we should flatten the TypeName components (package + name) into this type, and name it ErrorTypeName

Comment on lines 68 to 69
record ErrorResolutionResult(
String errorName, String package_, com.palantir.conjure.spec.ErrorNamespace namespace) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to use the new ErrorTypeName type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Updated.

docs: optional<Documentation>
deprecated: optional<Documentation>
markers: list<Type>
tags: set<string>
EndpointName:
alias: string
docs: Should be in lowerCamelCase.
EndpointError:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this to ErrorTypeName? It's basically equivalent to TypeName, but for errors

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry: this type makes sense, but should encapsulate a pair of ErrorTypeName (package/namespace/name) + docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

carterkozak
carterkozak previously approved these changes Nov 5, 2024
Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants