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

fix: Propagate Premium Features flag value to configuration #19935

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

mshabarov
Copy link
Contributor

Description

This adds missing codes into app configuration factory that propagates the PREMIUM_FEATURES flag value from token file to app config. This value can be retrieved from deployment configuration in runtime.

Related-to #19846

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@mshabarov mshabarov requested a review from tltv September 11, 2024 11:24
Copy link

github-actions bot commented Sep 11, 2024

Test Results

1 135 files  +  544  1 135 suites  +544   1h 26m 26s ⏱️ + 14m 20s
7 393 tests +6 374  7 343 ✅ +6 359  50 💤 +15  0 ❌ ±0 
7 732 runs  +6 394  7 672 ✅ +6 379  60 💤 +15  0 ❌ ±0 

Results for commit 82c2d32. ± Comparison against base commit c4bd620.

♻️ This comment has been updated with latest results.

@@ -156,6 +156,28 @@ public void create_propertiesAreReadFromContext() throws IOException {
configuration.getStringProperty("foo", null));
}

@Test
public void create_tokenFileWithPremiumFlag_premiumFlagIsPropagatedToDeploymentConfiguration()
Copy link
Member

Choose a reason for hiding this comment

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

Is this test adding anything that other tests here don't already test? This seems to just test same thing with different constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently not, because no test was failing before, though this property wasn't populated :)

Seems we don't have tests that checks that all possible properties are propagated from token file to config. I'll try to do such a test.

Copy link
Member

Choose a reason for hiding this comment

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

It's a good idea to add such a test. But it will not help with new properties, unless there is for example a list of properties that has to be updated for new properties. It could be in Constants for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is problematic, as AbstractConfigurationFactory uses a subset of properties that are declared in Constants and InitParameters, thus, we need to refactor the properties names to group them accordingly, e.g. in separate classes or by marking with comments, if it works. Looks like a bigger work, than just to write one test.

…low/plugin/maven/BuildDevBundleMojo.java

Co-authored-by: Tomi Virtanen <tltv@vaadin.com>
Copy link

sonarcloud bot commented Sep 11, 2024

Copy link
Member

@tltv tltv left a comment

Choose a reason for hiding this comment

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

Approving. Test can be updated also later.

@mshabarov mshabarov merged commit 69ebbc8 into main Sep 12, 2024
26 checks passed
@mshabarov mshabarov deleted the hash-app-names branch September 12, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants