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

[WIP] - Amazon Q Code Transform: Enforce valid JDK for user provided JAVA_HOME #4945

Closed
wants to merge 9 commits into from

Conversation

arangatang
Copy link
Contributor

@arangatang arangatang commented May 7, 2024

Problem

As part of the Code Transformation Process, users can provide a custom JAVA_HOME. Previously we only verified if the default JAVA_HOME was correctly detected and not this user provided JAVA_HOME.
This meant customers could pass an invalid JDK which could lead to the following problems:

  1. Pass a path thats not even a JDK -> Causing build errors
  2. Pass a path thats the wrong JDK version -> I.e. 17 and leveraging backwards compatibllity when build requires 8/11. This obfuscates certain issues and makes them only detectable during the first backend build which builds using the JDK 8 or 11.
  3. Customers have to provide a custom JAVA_HOME multiple times upon retrying submission.

Secondary problem - Bugfix

Extracted to #4949

Solution

  1. If JAVA_HOME recorded into state use that when verifying mavens detected JAVA version
  2. Run validation also after JAVA_HOME is provided and ask customers to retry on failure.
  3. Change all occurences in Q Code Transform of tabId to tabID - Extracted to Fix bug where messages to chat got lost. #4949

Screenshots

Screenshots for main problem

  1. When running JDK 8 and user provides JDK 17 -> Ask customer to try again
Screenshot 2024-05-07 at 17 54 11
  1. When user retries with valid JDK, job continues
Screenshot 2024-05-07 at 17 55 18
  1. When user started a successfull job and provided a valid JDK version then subsequent jobs of same language version does not require users to provide JAVA_HOME again.
Screenshot 2024-05-07 at 17 56 24
  1. When user changes project to a JDK 11 project, we request a valid JDK version for that (even when JDK 8 version was successful for previous project)
Screenshot 2024-05-07 at 17 59 46

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@arangatang arangatang requested review from a team as code owners May 7, 2024 12:33
@arangatang arangatang marked this pull request as draft May 7, 2024 12:33
@arangatang arangatang self-assigned this May 7, 2024
@arangatang arangatang changed the title [WIP] - Amazon Q Code Transform: Enforce valid JDK for user provided JAVA_HOME Amazon Q Code Transform: Enforce valid JDK for user provided JAVA_HOME May 7, 2024
@arangatang arangatang marked this pull request as ready for review May 7, 2024 16:33
@arangatang arangatang requested a review from a team as a code owner May 7, 2024 16:33
@arangatang arangatang marked this pull request as draft May 7, 2024 17:44
@arangatang
Copy link
Contributor Author

arangatang commented May 7, 2024

Moved back to draft mode -> Discussed with team, i'll split this into two parts.

  1. To fix the tabId issue - Fix bug where messages to chat got lost. #4949
  2. Enforce valid JDK (this one)

@damntrecky damntrecky marked this pull request as ready for review May 9, 2024 22:43
@arangatang
Copy link
Contributor Author

Force push due to rebase against master.

@arangatang arangatang marked this pull request as draft May 10, 2024 15:19
@arangatang arangatang marked this pull request as ready for review May 15, 2024 16:55
@arangatang
Copy link
Contributor Author

Failing test seem to be flaky and is unrelated.

@arangatang arangatang marked this pull request as draft May 15, 2024 21:25
@arangatang
Copy link
Contributor Author

arangatang commented May 15, 2024

Having some discussion internally if this is the way we want to go forward with this, so moving to draft mode to avoid accidental merges until this is decided.

@arangatang arangatang changed the title Amazon Q Code Transform: Enforce valid JDK for user provided JAVA_HOME [WIP] - Amazon Q Code Transform: Enforce valid JDK for user provided JAVA_HOME May 22, 2024
@arangatang arangatang closed this May 24, 2024
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

4 participants