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

(feature) Detect undefined variations with the linter #2562

Closed
kna opened this issue Oct 23, 2024 · 5 comments · Fixed by #2563
Closed

(feature) Detect undefined variations with the linter #2562

kna opened this issue Oct 23, 2024 · 5 comments · Fixed by #2563
Assignees
Labels
📍 Assigned enhancement New feature or request good first issue Good for newcomers p1 High priority

Comments

@kna
Copy link

kna commented Oct 23, 2024

Requirements

A flag file might contain undefined variants due to a mistake.
I think it is better for the linter to report it as an error.

Example

The following flag file is incorrect because it uses an undefined variation(NOT_IN_VARIATIONS).

# flag.goff.yaml
flag_a:
  variations:
    A: true
    B: false
  defaultRule:
    variation: NOT_IN_VARIATIONS

But the linter does not report an error.

$ docker run --rm \
  -v ./flag.goff.yaml:/flag.goff.yaml \
  gofeatureflag/go-feature-flag-lint:v1.36.1 \
  --input-format=yaml \
  --input-file=/flag.goff.yaml
(no output)
@kna kna added enhancement New feature or request needs-triage A priority should be added to the issue labels Oct 23, 2024
@thomaspoignant
Copy link
Owner

@kna Yes this is very true, we should add this capability to the linter.

Good catch 👌

@thomaspoignant thomaspoignant added good first issue Good for newcomers p1 High priority ODHack9 and removed needs-triage A priority should be added to the issue labels Oct 23, 2024
@thomaspoignant thomaspoignant removed their assignment Oct 23, 2024
@thomaspoignant
Copy link
Owner

/assign-me

Copy link
Contributor

👋 Hey @thomaspoignant, thanks for your interest in this issue! 🎉

⚠ Note that this issue will become unassigned if it isn't closed within 10 days.

🔧 A maintainer can also add the 📌 Pinned label to prevent it from being unassigned automatically.

@thomaspoignant
Copy link
Owner

@kna thanks again for this issue.
I have open the PR #2563 to address this, feel free to review it, we will merge it for the next version of GO Feature Flag.

@kna
Copy link
Author

kna commented Oct 24, 2024

@thomaspoignant
Thank you for your quick responce and creating the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📍 Assigned enhancement New feature or request good first issue Good for newcomers p1 High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants