-
Notifications
You must be signed in to change notification settings - Fork 26
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
Enabled developer to input PR number for lsp4ij checkout input #1014
base: main
Are you sure you want to change the base?
Enabled developer to input PR number for lsp4ij checkout input #1014
Conversation
If a developer want to check out LSP4IJ based on a Example run @TrevCraw , Please suggest the changes in the wordings |
Reference workflow runs : https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/11276704777 -- Normal push/PR builds Manually running workflow examples https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/11276799815 ( developer entered PR number 411 and LTI version 24.0.9 --> merge commit sha value is not https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/11276805354 ( developer entered PR number 500 and LTI version 24.0.9 --> merge commit sha value is https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/11276809742 -- LTI main & LSP4IJ main-- ( user entered branch name , https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/11276824366 -- ( user entered merge commit sha as an input for LSP4IJ checkout and LTI 24.0.9 ) https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/11276832458 -- ( user entered LTI 24.0.9 and LSP4IJ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
|
||
For example, if you want to trigger the Build Workflow from a branch of the LTI repository and build against LSP4IJ PR number `500` while using the `main` branch of LTI, you would configure it as follows: | ||
|
||
<img alt="Example" height="300" src="images/Allow-developer-to-input-PR-number.png" width="300" style="display: block; margin: 0 auto;"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the image to show the new text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the image with the same name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to update the other images in the doc where the inputs for running the build.yaml are shown. I think there are two other places in this doc. Check the other doc files as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TrevCraw, I updated the other images in the document and checked the other document files as well, but I couldn't find any images showing the inputs for running the build.yaml.
LSP4IJ_BRANCH: ${{ inputs.lsp4ijBranch }} | ||
name: Fetch Commit ${{ inputs.refLsp4ij || '' }} | ||
steps: | ||
- name: Extract Merge Commit SHA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have code in cronJob.yaml to extract the merge commit SHA. Is there any way that we can re-use that code somehow instead of re-doing it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TrevCraw , I tried investigating ways to reuse code from the cronJob.yaml
file. We only require a specific portion of the code of the fetch_all_pull_request_shas
job, and we do not need the complete job or the other three jobs. During my investigation, I found the following:
GitHub Actions does not support reusing a single job or some portion of a job from one workflow in another. Instead, we can achieve this by creating a new reusable workflow file that includes only the specific job(s) we want to reuse, but we can't create a common code for both the jobs that is, we use different values are being passed in the jobs, such as checkout_name
in the fetch_merge_commit_sha_from_lsp4ij_PR
job (from build.yaml
) and is_empty
in the fetch_all_pull_request_shas
job. The pr_details
variable is common to both jobs but has different values in each case.
If you think to use the code written in the 'Extract Merge Commit SHA' step in an additional workflow file, we should pass the values of ${{ env.REF_LSP4IJ }}
and ${{ env.LSP4IJ_BRANCH }}
as inputs to the new workflow file. Similarly, we need to get $pr_details
and $checkout_name
as outputs from the new workflow file, which will result in one additional build beyond the builds listed below.
Co-authored-by: Trevor Crawford <[email protected]>
Co-authored-by: Trevor Crawford <[email protected]>
Co-authored-by: Trevor Crawford <[email protected]>
I tested the changes today, You can check the build results below https://github.com/OpenLiberty/liberty-tools-intellij/actions/runs/11853422736/job/33033521118?pr=1014 -- Normal push/PR builds I can confirm that artifact names are working correct as expected. |
Fixes #998
Allowing developers to input the
PR number
for LSP4IJ checkout.I made some slight changes to the artifact name setup, but there is no effect on previous scenarios. Additionally, I have now enabled specifying the LSP4IJ branch name, tag, PR number, or commit SHA based on the input provided by the developer.