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

Found a possibility of limiting the Linux build only for the 24.0.9 LTI version #1218

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

vaisakhkannan
Copy link
Contributor

@vaisakhkannan vaisakhkannan commented Jan 10, 2025

Fixes #1217

This fix added a check (based on the value 'excludeLTITag') on macOS and Windows to verify if 'refLTITag' is equal to '24.0.9'. The value of 'excludeLTITag' is used to determine whether the Job build need to be executed. This 'excludeLTITag' variable can be removed once the '24.0.9' version is removed from the 'tag' array of the cron job build.
But it is not necessary. That means, If we remove 24.0.9 from the LTI tags in the cronJob.yaml file, there is no need to modify anything in the build.yaml file. The variable excludeLTITag will calculate its value and will return false always since it not there in LTI tag. This ensures it works as expected for both normal and cron job builds.

I tried this solution to make changes in the build.yaml file without using the if condition for all steps in the job. By calculating the filtering of the OS based on the LTI tag 24.0.9 at the matrix level, this fix becomes more feasible.

@vaisakhkannan
Copy link
Contributor Author

vaisakhkannan commented Jan 10, 2025

Build Resullts example : https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12704625074

https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12704635529

https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12705078967

NOTE: You can see that for the LTI tag 24.0.9, both Windows and Mac have green builds because all the steps were skipped. For the 24.0.12 LTI tag, I haven't created the tag in my fork, which caused the failure in the checkout step. We can ignore it for now, and it will run on the remote repository.

Copy link
Contributor

@anusreelakshmi934 anusreelakshmi934 left a comment

Choose a reason for hiding this comment

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

Can we just exclude the windows and mac matrix instead so that the condition doesn't need to be checked in every step?

@anusreelakshmi934 anusreelakshmi934 self-requested a review January 13, 2025 08:08
@vaisakhkannan
Copy link
Contributor Author

Hi @anusreelakshmi934 and @TrevCraw ,
I have updated the PR based on your suggestions and below are the build results , please check

https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12742932719 -> Normal Build
https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12743353818

https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12742954503 -> Cron Job builds
https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12743638005

NOTE: Only linux os is listed in the 24.0.9 LTI tag builds and you can see the change in name due to matrix constraints, please let me know the suggestions if any,

os: macOS-latest
reportName: mac-test-report
- runtime: windows
os: [ ubuntu-latest, macOS-latest, windows-latest ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason the matrix needed to be changed up? Could we not just exclude runtime: windows or runtime: mac?

Copy link
Contributor Author

@vaisakhkannan vaisakhkannan Jan 14, 2025

Choose a reason for hiding this comment

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

Yes @TrevCraw ,I tried keeping the runtime, but I am getting the error below because I am using exclude to limit the OS for 24.0.9.

Screenshot 2025-01-14 at 11 43 15 AM

https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12761300513

Screenshot 2025-01-14 at 11 50 09 AM

I tried using both include (the code currently in the main branch) and exclude(by keeping runtime), but the logic for running 24.0.9 LTI on Linux only is failing, and in some cases, I am encountering other errors as well.

https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12761891237

Screenshot 2025-01-14 at 11 48 48 AM

NOTE: So, if we are using exclude, the key should be the same as the matrix name.

Based on the error, I tried adding os to the matrix, but this resulted in an increased number of builds (combining both runtime matrix and OS matrix). This is not desirable for Normal and Cron Job builds.

Screenshot 2025-01-14 at 12 03 14 PM - Normal build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TrevCraw , I tried a different approach today that is working fine by keeping the runtime: mac. This allows adding multiple OS options anytime by giving them different names and assigning unique names to the artifacts (both zip and test-reports)

@TrevCraw
Copy link
Contributor

I would also recommend updating the cron job documentation here - https://github.com/OpenLiberty/liberty-tools-intellij/blob/main/docs/LSP4IJ-Continuous-Integration.md#results-from-the-cron-job - to state what the true and false values in the job/build name are for and that they can be ignored by those reviewing the results.

Copy link
Contributor

@mrglavas mrglavas left a comment

Choose a reason for hiding this comment

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

See review comments.

.github/workflows/build.yaml Outdated Show resolved Hide resolved
.github/workflows/build.yaml Outdated Show resolved Hide resolved
@vaisakhkannan
Copy link
Contributor Author

vaisakhkannan commented Jan 15, 2025

TrevCraw
TrevCraw previously approved these changes Jan 26, 2025
Copy link
Contributor

@TrevCraw TrevCraw left a comment

Choose a reason for hiding this comment

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

The changes seem OK to me, but I'm confused by the shared results. What is linux-1, linux-2, etc? Why are there multiple builds of the same OS? Is that just testing something out or are the builds now like that by default?

@vaisakhkannan
Copy link
Contributor Author

Is that just testing something out or are the builds now like that by default?

@TrevCraw , No, that's not the default. I added linux-1 and linux-2 for the same OS to verify that the builds are executing properly and to ensure that artifact names are unique for each runtime, preventing any name collisions in the reports. We also have scenarios that require testing by running multiple runtime instances simultaneously for mutiple os.I have checked that possibility and its working. Currently, in this PR, there is only one runtime instance per OS

![specify LTI tag to limit os](images/specify-LTI-tag-to-limit-os.png)

There is no need to update the code each time. That means, If we remove `24.0.9` from the **LTI** tags in the **cronJob.yaml** file, there is no need to modify anything in the **build.yaml** file. The variable `excludeLTITag` will calculate its value and will return `false` always since it not there in **LTI** tag. This ensures it works as expected for both **normal** and **cron job** builds.
Copy link
Member

Choose a reason for hiding this comment

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

since it is not there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the change you suggested, Thanks for the suggestion

@turkeylurkey
Copy link
Member

turkeylurkey commented Jan 27, 2025

What is linux-1, linux-2, etc?

@TrevCraw I think that was answering my question about running ten linux builds when you want to reproduce an intermittent error.

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.

Check the possibility of limiting the Linux build only for the 24.0.9 LTI version.
5 participants