Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: refactor entry into deployment and runtime#14575

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 8 commits intodk/runtime-configsfromstevenmasley/runtime_refactor
Sep 5, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedSep 5, 2024
edited
Loading

  • RuntimeEntry has no startup value, and omits functions required to be serpent compatible.
  • DeploymentEntry has noNew() function because it is always instantiated from aserpent context. There is no point to implementing aNew() function that will never be used in prod.
  • Now there exists aManager that will be instantiated once for the app. TheManager producesResolvers such that we can implement some shared cache.
  • Resolvers do not know about namespaces. Only managers (the factory) does now.

RuntimeEntry has no startup value, and omits functions requiredto be serpent compatible.
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

LGTM!:shipit:

}

func NewMemoryCachedResolver(cache *syncmap.Map[string, cacheEntry], wrapped Resolver) *MemoryCachedResolver {
return &MemoryCachedResolver{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: panic here ifcache is nil

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think we should actually delete the cache resolver before we merge tomain. Was just testing out some api usage with it.

// Validate that it returns that value.
require.Equal(t, base.String(), field.String())
// Validate that there is no org-level override right now.
_, err := field.Resolve(ctx, mgr.DeploymentResolver(db))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:DeploymentResolver feels like the wrong name; let's keep it for now but it's worth revisiting, I feel.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

👍

// resolver from the manager.
// TODO: Delete MemoryCacheManager and implement it properly in 'StoreManager'.
type MemoryCacheManager struct {
cache *syncmap.Map[string, cacheEntry]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! TIL aboutsyncmap

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Handy little guy

Co-authored-by: Danny Kopping <danny@coder.com>
@EmyrkEmyrk marked this pull request as ready for reviewSeptember 5, 2024 21:12
@EmyrkEmyrk merged commit23ef17e intodk/runtime-configsSep 5, 2024
27 checks passed
@EmyrkEmyrk deleted the stevenmasley/runtime_refactor branchSeptember 5, 2024 21:12
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 5, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Emyrk@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp