Skip to content

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Sep 29, 2025

@lukas-reining this fixes the ongoing test compilation issue with ng-test we discussed today in main.

The reason you didn't see it locally is because if we have a compiled dist/ in ../web (the local version of @openfeature/web-sdk) it's resolved, but the main build doesn't have this at the point the tests run.

I could have fixed this by adding a compile step, but I think it's always better to run the tests against src/ of our local peers instead of dist/ (or else things get really weird and you can sometimes not realize you're testing against stale code)

This PR fixes this issue (confirmed by deleting the ../web dist locally, seeing the same errors, and then applying this fix).

NOTE: none of these changes impact prod code - just test configuration and one TS-only code change.

@toddbaert toddbaert requested review from a team as code owners September 29, 2025 23:06
Copy link
Contributor

Summary of Changes

Hello @toddbaert, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a recurring test compilation failure in the main branch affecting Angular tests. The fix involves reconfiguring the TypeScript specification file for the Angular SDK to correctly resolve local peer dependencies directly from their source code (src/) rather than relying on potentially missing or outdated compiled dist/ artifacts. This ensures a more robust and consistent testing environment, particularly in CI pipelines where compiled dependencies might not always be present. Additionally, a minor type assertion was added in the web SDK for clarity.

Highlights

  • Test Compilation Fix: Addresses an ongoing test compilation issue in the main branch specifically affecting Angular tests.
  • Dependency Resolution: Modifies tsconfig.spec.json to resolve local peer dependencies (@openfeature/core, @openfeature/web-sdk) directly from their src/ directories instead of relying on compiled dist/ artifacts, ensuring tests run against up-to-date source code.
  • TypeScript Configuration Update: Updates tsconfig.spec.json for the Angular SDK to include baseUrl, paths for local dependencies, and relaxes some strictness checks (noImplicitOverride, noPropertyAccessFromIndexSignature, strict: false) for the spec files.
  • Type Assertion in Web SDK: Adds a type assertion as Promise<void> to the maybePromise variable in packages/web/src/open-feature.ts to clarify its type in a conditional check.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Comment on lines +9 to +15
"baseUrl": "../",
"paths": {
"angular": [
"./dist/angular"
]
],
"@openfeature/core": [ "../../shared/src" ],
"@openfeature/web-sdk": [ "../../web/src" ]
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the fix.

Comment on lines +18 to +21
"emitDecoratorMetadata": true,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"strict": false
Copy link
Member Author

@toddbaert toddbaert Sep 29, 2025

Choose a reason for hiding this comment

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

I had to add these, because now the ng-test step compiles some code from the shared packages, and doesn't tolerate some stuff there without these.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a test compilation issue by pointing the Angular tests to the src directory of local dependencies instead of dist. This is a good approach to ensure tests run against the latest code. However, my main concern is that several TypeScript strictness checks are disabled in tsconfig.spec.json to make the build pass. This can hide potential bugs and should be avoided. I've left a comment to remove these overrides and fix the underlying type errors instead. I also left a comment on a type assertion that seems to be a workaround for one of these type errors.

Comment on lines +19 to +21
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"strict": false
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Disabling these TypeScript strictness checks (noImplicitOverride, noPropertyAccessFromIndexSignature, strict) can hide potential bugs and reduces the benefits of using TypeScript. It's better to address the underlying type errors directly rather than turning off the compiler checks. Please remove these overrides and fix any resulting compilation errors.

Copy link
Member Author

@toddbaert toddbaert Sep 29, 2025

Choose a reason for hiding this comment

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

This is true, but this is only for test code (tsconfig.spec.json); without this, we'd have to make a bunch of changes to @openfeature/core and @openfeature/web just to satisfy it's some of it's misconceptions.

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>

// only reconcile if the onContextChange method returns a promise
if (typeof maybePromise?.then === 'function') {
if (maybePromise && typeof maybePromise?.then === 'function') {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only thing the ng-compiler was complaining about I could not ignore - obviously there's no real runtime change here, it just makes the compiler happy.

@lukas-reining lukas-reining merged commit f42011d into main Sep 30, 2025
12 checks passed
@lukas-reining lukas-reining deleted the fix/ng-test branch September 30, 2025 06:57
lukas-reining added a commit that referenced this pull request Sep 30, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.0.17](angular-sdk-v0.0.16...angular-sdk-v0.0.17)
(2025-09-30)


### 🐛 Bug Fixes

* angular tests in main
([#1251](#1251))
([f42011d](f42011d))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @openfeature/web-sdk bumped from ^1.5.0 to ^1.6.2

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Lukas Reining <lukas.reining@codecentric.de>
lukas-reining pushed a commit that referenced this pull request Sep 30, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.6.2](web-sdk-v1.6.1...web-sdk-v1.6.2)
(2025-09-30)


### 🐛 Bug Fixes

* angular tests in main
([#1251](#1251))
([f42011d](f42011d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
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.

2 participants