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 a runtime for server logic #258

Merged
merged 3 commits into from
Dec 22, 2023
Merged

Add a runtime for server logic #258

merged 3 commits into from
Dec 22, 2023

Conversation

sfackler
Copy link
Member

@sfackler sfackler commented Jul 7, 2023

While the ConjureRuntime is currently empty, it will enable us to support things like dynamic configuration of serializable encodings and custom request body limits.

cc #182

fn endpoints(&self) -> #vec<#box_<dyn conjure_http::server::#endpoint_name<I, O> + Sync + Send>>
fn endpoints(
&self,
_: &conjure_http::private::Arc<conjure_http::server::ConjureRuntime>,
Copy link
Member Author

Choose a reason for hiding this comment

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

Conjure-generated server logic just ignores the runtime for now. When #245 is implemented it'll be able to take advantage of the runtime as well.

where
I: IntoIterator,
I::Item: AsRef<str>;
}

/// A decoder which converts a single value using its [`FromStr`] implementation.
pub enum FromStrDecoder {}
pub struct FromStrDecoder<'a> {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we'd ever want to pull dynamic logic for this kind of thing but I'm future proofing just in case.

@sfackler
Copy link
Member Author

sfackler commented Jul 7, 2023

I'll be doing the same thing for clients in a separate PR.

Base automatically changed from custom-server to master July 7, 2023 19:07
@changelog-app
Copy link

changelog-app bot commented Jul 7, 2023

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

Added a new argument to Conjure endpoints to enable future runtime behavior customization.

Check the box to generate changelog(s)

  • Generate changelog entry

@sfackler sfackler changed the title [Stacked] Add a runtime for server logic Add a runtime for server logic Jul 7, 2023
Copy link

@TheKeveloper TheKeveloper left a comment

Choose a reason for hiding this comment

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

LGTM!

@sfackler sfackler merged commit f99d16b into master Dec 22, 2023
@sfackler sfackler deleted the server-runtime branch December 22, 2023 00:00
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.

3 participants