Conversation
…martcontractkit/cre-cli into add-deployment-registry-selector
| @@ -1,4 +1,4 @@ | |||
| package testutil | |||
| package testsettings | |||
There was a problem hiding this comment.
This was moved to avoid an import cycle
5accbfc to
f57f2be
Compare
| if deploymentRegistry == "" { | ||
| return defaultFromEnvironmentSet(envSet), nil | ||
| } |
There was a problem hiding this comment.
Maybe we should add a follow up task to plan full migration and clean up? E.g. introduce extra warning and deprecation message, automatically "fix" user settings without this registry, and after some time clean up this branch, after majority of users will migrate.
There was a problem hiding this comment.
Can you clarify what you mean by automatically "fix"? Fetch tenantCtx again and rebuild struct?
There was a problem hiding this comment.
Yes, run the login flow in the background to fetch tenant ctx
| if tenantCtx == nil { | ||
| return nil, fmt.Errorf("deployment-registry %q is set but user context is not available — run `cre login` and retry", deploymentRegistry) | ||
| } |
There was a problem hiding this comment.
What if we started the login flow here, so we make the experience more smooth?
There was a problem hiding this comment.
This is a good suggestion 👍
There was a problem hiding this comment.
So I looked into this and it's more complicated than I first thought. I suggest we follow up as a UX enhancement and keep this PR scope down
There was a problem hiding this comment.
Can you add a task for it?
| // ChainNameFromSelectorString parses a raw chain-selector string and resolves | ||
| // it to a chain name. It combines the string-to-uint64 conversion with the | ||
| // selector-to-name lookup in a single call. | ||
| func ChainNameFromSelectorString(raw string) (string, error) { |
There was a problem hiding this comment.
nit: we could have some tests for that
j-nowak
left a comment
There was a problem hiding this comment.
Approved, can you add tickets for follow ups?
Summary
Adds an optional deployment-registry field to user-workflow settings that lets workflow commands resolve registry configuration dynamically from context.yaml instead of using hardcoded environments.yaml defaults. When omitted, behaviour is unchanged (backward compatible). Off-chain registries are gated in production and rejected by on-chain-only commands (deploy, pause, activate, delete) with a clear error until off-chain routing is implemented.
Changes:
Example workflow.yaml
Precedence hierarchy