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

Add an error condition for an unstable Microsoft OpenJDK build #263

Conversation

dmitry-shibanov
Copy link
Contributor

@dmitry-shibanov dmitry-shibanov commented Dec 13, 2021

Description:
In scope of this pull request we add condition to throw an error for an unstable Microsoft OpenJDK build. Some distributions support early access versions with syntax 11-ea. For now Microsoft OpenJDK does not provide ea versions. The action will not throw an error if user tries to install ea version for Microsoft OpenJDK

Related issue:

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@dmitry-shibanov
Copy link
Contributor Author

Hello everyone. Could you please take a look at these changes.
cc: @brcrista @brendandburns

@@ -40,6 +40,11 @@ export class MicrosoftDistributions extends JavaBase {
if (this.architecture !== 'x64' && this.architecture !== 'aarch64') {
throw new Error(`Unsupported architecture: ${this.architecture}`);
}

if (!this.stable) {
throw new Error('Unstable versions are not supported');
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the value of adding a special error message here? We only have two hardcoded versions currently. If someone requests something that's not one of those versions, we'll raise an error and show the available versions (lines 62-70 of this file).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can get ga/ea versions of java releases, but Microsoft OpenJDK builds do not have ea versions. If we pass 11-ea in java-version input, the action won't throw an error and install stable version, because the action normalizes version to 11 and set stable to the false value. For now I think we should write a condition to throw an error for ea builds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throw new Error('Unstable versions are not supported');
throw new Error('Early access versions are not supported');

While it's true that it's not a stable version, "unstable" has a stronger denotation.

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. Thank you.

@dmitry-shibanov dmitry-shibanov merged commit d23aed3 into actions:main Dec 15, 2021
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