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

Apply default version to a serverless config #166

Merged
merged 3 commits into from
May 12, 2023
Merged

Apply default version to a serverless config #166

merged 3 commits into from
May 12, 2023

Conversation

iwysiu
Copy link
Contributor

@iwysiu iwysiu commented May 9, 2023

An edge case that I didn't catch while developing. It can be reproduced by using the aws provisioner app to provision a serverless OpenSearch version (we have one in US East (Ohio)) and opening and trying to save the config. Before this fix, we would get the No version set error, but this applys a version when the config editor is open (which is what it did before the detecting version change). We don't really have any tests for this code path at the moment, but I can whip together a coerceOptions test if we think we need one.

@iwysiu iwysiu requested a review from a team as a code owner May 9, 2023 19:34
@iwysiu iwysiu requested review from sarahzinger and idastambuk and removed request for a team May 9, 2023 19:34
@github-actions
Copy link

github-actions bot commented May 9, 2023

Backend code coverage report for PR #166
No changes

@github-actions
Copy link

github-actions bot commented May 9, 2023

Frontend code coverage report for PR #166

Plugin Main PR Difference
src 77.82% 77.85% .03%

@github-actions
Copy link

github-actions bot commented May 9, 2023

Levitate is-compatible report:

🔍 Resolving @grafana/data@latest...
🔍 Resolving @grafana/ui@latest...
🔍 Resolving @grafana/runtime@latest...
🔍 Resolving @grafana/e2e-selectors@latest...

🔬 Checking compatibility between ./src/module.ts and @grafana/data@9.5.2...
✔ Found @grafana/data version 9.0.2 locally

🔬 Checking compatibility between ./src/module.ts and @grafana/ui@9.5.2...
✔ Found @grafana/ui version 9.0.2 locally

🔬 Checking compatibility between ./src/module.ts and @grafana/runtime@9.5.2...
✔ Found @grafana/runtime version 9.0.2 locally

🔬 Checking compatibility between ./src/module.ts and @grafana/e2e-selectors@9.5.2...
✔ Found @grafana/e2e-selectors version 9.0.2 locally

✔️ ./src/module.ts appears to be compatible with @grafana/data,@grafana/ui,@grafana/runtime,@grafana/e2e-selectors

Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

I'm thinking in the future we will remove the feature toggle but still need to set a default option for serverless but in that case we won't need to do all of this right since the version/flavor are more obvious? Maybe we should write the code for serverless as a separate if conditional that we can keep as is after we remove the feature flag, wdyt?

@iwysiu
Copy link
Contributor Author

iwysiu commented May 9, 2023

I'm thinking in the future we will remove the feature toggle but still need to set a default option for serverless but in that case we won't need to do all of this right since the version/flavor are more obvious? Maybe we should write the code for serverless as a separate if conditional that we can keep as is after we remove the feature flag, wdyt?

I think this is what you meant? In the long term, we should probably refactor the code to handle serverless cases without a dummy version, but I figured that could wait until we decide whatever refactoring we want to do to opensearch.

@iwysiu iwysiu requested a review from sarahzinger May 10, 2023 14:51
if (options.jsonData.serverless) {
flavor = flavor || Flavor.OpenSearch;
version = version || '1.0.0';
}
Copy link
Member

Choose a reason for hiding this comment

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

so why is this an Or case? I thought in serverless was always the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, it was in the old code and I didn't think about it

@iwysiu iwysiu merged commit a0e9ba2 into main May 12, 2023
5 checks passed
@iwysiu iwysiu deleted the iwysiu/165wq branch May 12, 2023 12:58
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.

None yet

3 participants