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 11 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
os: macOS-latest
reportName: mac-test-report
- runtime: windows
os: [ ubuntu-latest, macOS-latest, windows-latest ]
Copy link
Member

Choose a reason for hiding this comment

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

In the past if we wanted to run Mac twice we could just add "mac1, mac2" to the matrix.runtime. With this change it doesn't look like we can do that anymore. Can you provide instructions how to run a test multiple times or put the matrix back the way it was?

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 @turkeylurkey , You can add multiple OS options to the OS matrix as shown below without making any other changes.

os: [ ubuntu-latest, macOS-latest, windows-latest, ubuntu-latest, macOS-latest, windows-latest ]

NOTE: Make sure to add only the OS, not the runtime, as I removed the runtime due to the use of exclude.

Normal build Screenshot

Screenshot 2025-01-14 at 10 05 36 AM

Copy link
Member

Choose a reason for hiding this comment

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

Will the test report names collide?

Copy link
Contributor Author

@vaisakhkannan vaisakhkannan Jan 15, 2025

Choose a reason for hiding this comment

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

Yes you are correct @turkeylurkey , I tried a different approach today that is working fine. This allows adding multiple OS options anytime by giving them different names and assigning unique names to the artifacts (both zip and test-reports)

For example

jobs:
  build:
    name: build ( ${{ matrix.runtime.name }}, ${{ matrix.excludeLTITag }} )
    runs-on: ${{ matrix.runtime.os }}
    strategy:
      fail-fast: false
      matrix:
        runtime:
          - name: linux-1
            os: ubuntu-latest
            reportName: linux-test-report-1
          - name: mac-1
            os: macOS-latest
            reportName: mac-test-report-1
          - name: windows-1
            os: windows-latest
            reportName: windows-test-report-1
          - name: linux-2
            os: ubuntu-latest
            reportName: linux-test-report-2
          - name: mac-2
            os: macOS-latest
            reportName: mac-test-report-2
          - name: windows-2
            os: windows-latest
            reportName: windows-test-report-2
        excludeLTITag:
          - ${{ inputs.refLTITag == '24.0.9' }}
        exclude:
          - excludeLTITag: true
            runtime:
              name: mac-1
          - excludeLTITag: true
            runtime:
              name: mac-2
          - excludeLTITag: true
            runtime:
              name: windows-1
          - excludeLTITag: true
            runtime:
              name: windows-2

please check the build results to verify.

@vaisakhkannan
Copy link
Contributor Author

vaisakhkannan commented Jan 15, 2025

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