Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Add WithUpstreamOptions server option #10

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

sevein
Copy link
Contributor

@sevein sevein commented Oct 12, 2021

What changed?
I'm adding a new server option WithUpstreamOptions(options ...temporal.ServerOption) enabling users to configure the Temporal server more granularly., e.g.:

opts := []temporalite.ServerOption{
    temporalite.WithNamespaces("default"),
    temporalite.WithDynamicPorts(),
    temporalite.WithPersistenceDisabled(),
    temporalite.WithUpstreamOptions(
        temporal.ForServices([]string{primitives.FrontendService}),
    ),
}
srv, err := temporalite.NewServer(opts...)

Why?
This allows users configuring all server options, like InterruptOn, without the maintenance burden of having dedicated functions.

How did you test it?
Tested locally.

Potential risks
This is a backward incompatible change. Before, temporal.InterruptOn(temporal.InterruptCh()) was used. This pull request proposes to leave the interrupt option undefined to match Temporal's default.

Is hotfix candidate?

server.go Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #10 (e475855) into main (94be8e0) will decrease coverage by 0.19%.
The diff coverage is 56.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
- Coverage   47.13%   46.94%   -0.20%     
==========================================
  Files          11       11              
  Lines         611      622      +11     
==========================================
+ Hits          288      292       +4     
- Misses        306      312       +6     
- Partials       17       18       +1     
Impacted Files Coverage Δ
internal/liteconfig/config.go 90.29% <ø> (ø)
options.go 62.85% <0.00%> (-8.12%) ⬇️
server.go 64.78% <75.00%> (-0.84%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94be8e0...e475855. Read the comment docs.

Copy link
Collaborator

@jlegrone jlegrone left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@jlegrone jlegrone merged commit 1cccf14 into temporalio:main Oct 13, 2021
@sevein sevein deleted the dev/upstream-opts branch October 14, 2021 06:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants