Skip to content

Rofl public vars#705

Merged
martintomazic merged 2 commits into
masterfrom
martin/feature/rofl-public-vars
Jul 9, 2026
Merged

Rofl public vars#705
martintomazic merged 2 commits into
masterfrom
martin/feature/rofl-public-vars

Conversation

@martintomazic

@martintomazic martintomazic commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Part of oasisprotocol/oasis-sdk#2248.

Used public var instead of env to make sure people don't accidentally set secrets here.

Tested it with https://github.com/oasisprotocol/Honoroll/pull/440.

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for oasisprotocol-cli canceled.

Name Link
🔨 Latest commit 17537ed
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-cli/deploys/6a50085b09290f00087cac52

@martintomazic martintomazic force-pushed the martin/feature/rofl-public-vars branch from c08fc30 to f39a94f Compare July 6, 2026 10:56

@martintomazic martintomazic left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Followed the style and organisation 1:1 with oasis rofl secrets.

Comment on lines +56 to +60
prevConfig := *cliConfig.Global()
cliConfig.ResetDefaults()
t.Cleanup(func() {
*cliConfig.Global() = prevConfig
})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NIT: existing global config makes things hard to test cleanly :((

Comment thread build/rofl/artifacts.go Outdated
@martintomazic martintomazic force-pushed the martin/feature/rofl-public-vars branch from f39a94f to 9dc9218 Compare July 6, 2026 12:24
@martintomazic martintomazic requested review from kostko and matevz July 6, 2026 12:25
@martintomazic martintomazic marked this pull request as ready for review July 6, 2026 12:26

@matevz matevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you define a public var with the same name as the existing secret, Oasis CLI should fail.

Comment thread docs/rofl.md Outdated
Comment thread docs/rofl.md Outdated
@martintomazic martintomazic force-pushed the martin/feature/rofl-public-vars branch from 9dc9218 to e3c9919 Compare July 6, 2026 22:44
@martintomazic

Copy link
Copy Markdown
Contributor Author

If you define a public var with the same name as the existing secret, Oasis CLI should fail.

Private variable name (if --public-name is set) is available inside rofl.yaml so the fix should work in all cases...? Writing tests for the new validation would require a thorough refactor of the existing code, so I only tested manually for now.

Note there is similar issue with secrets definitions overlapping between each other:

the secret name is capitalized and spaces are replaced with underscores, so a secret called my secret will be available as MY_SECRET.

meaning cli should probably not allow setting my secret and MY_SECRET at the same time as a rofl secret, but I would ignore this as 1. existing and 2. app admin should be responsible.

@martintomazic martintomazic requested a review from matevz July 6, 2026 23:00

@matevz matevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please also mention special env. metadata fields behavior in the ROFL manifest specs https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/features/manifest.md

Comment thread cmd/rofl/public_var.go
@martintomazic martintomazic force-pushed the martin/feature/rofl-public-vars branch from e3c9919 to 813ada8 Compare July 7, 2026 20:23
@martintomazic martintomazic requested a review from matevz July 7, 2026 20:23
@peternose

Copy link
Copy Markdown
Contributor

Please also mention special env. metadata fields behavior in the ROFL manifest specs https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/features/manifest.md

You could also gather these variables under the same key, e.g. metadata["env"] = "city=London,country=England".

@martintomazic martintomazic force-pushed the martin/feature/rofl-public-vars branch from 813ada8 to b19304f Compare July 9, 2026 13:56
@martintomazic martintomazic force-pushed the martin/feature/rofl-public-vars branch from b19304f to 17537ed Compare July 9, 2026 20:45
@martintomazic martintomazic merged commit fe04d6c into master Jul 9, 2026
5 checks passed
@martintomazic martintomazic deleted the martin/feature/rofl-public-vars branch July 9, 2026 21:39
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.

4 participants