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

Multiple usages of config usages show up in schema #1121

Closed
wesbillman opened this issue Mar 21, 2024 · 1 comment · Fixed by #1336 or #1337
Closed

Multiple usages of config usages show up in schema #1121

wesbillman opened this issue Mar 21, 2024 · 1 comment · Fixed by #1336 or #1337
Assignees
Labels
good first issue Good for newcomers

Comments

@wesbillman
Copy link
Collaborator

If a file has something like this in it:

var hostname = ftl.Config[string]("FTL_ENDPOINT")

// and somewhere else in that package they have

var frontendURL = ftl.Config[string]("FTL_ENDPOINT")

The schema will have duplicates

module echo {
  config FTL_ENDPOINT String

  config FTL_ENDPOINT String
@github-actions github-actions bot added the triage Issue needs triaging label Mar 21, 2024
@wesbillman wesbillman added the good first issue Good for newcomers label Apr 3, 2024
@alecthomas alecthomas removed the triage Issue needs triaging label Apr 8, 2024
@deniseli deniseli self-assigned this Apr 24, 2024
@deniseli
Copy link
Contributor

Continuing on from the above PR:

  • Add check for duplicate databases
  • Add checks to backend for all 3 types

deniseli added a commit that referenced this issue Apr 25, 2024
deniseli added a commit that referenced this issue Apr 26, 2024
Fixes #1121

This adds backend schema validation preventing duplicate configs,
secrets, and databases within a module. This also adds go-runtime
validation preventing duplicate databases. Go-runtime validation for
duplicate configs/secrets was added in PR
#1328
deniseli added a commit that referenced this issue Apr 26, 2024
Fixes #1121

* Addresses comments in PR #1336
* Adds additional duplication error case for configs/secrets with the
same name but different types, which also simplifies the overall
validation logic
deniseli added a commit that referenced this issue Apr 26, 2024
Fix a bug I introduced in prior PRs for
#1121

In the go-runtime validation, we would previously error if a secret and
config had the same name. This fixes that error and adds tests to ensure
we don't rebreak this either in the go-runtime nor on the backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
3 participants