Skip to content

Commit f879f81

Browse files
resolved merge conflicts
2 parents 25a376e + 2efbd60 commit f879f81

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1148
-486
lines changed

.github/workflows/build.yaml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ on:
2929
required: true
3030
type: boolean
3131
default: false
32+
lsp4ijPrNumber:
33+
description: 'Run build with an LSP4IJ PR. Make sure to enter the LSP4IJ PR number in the "Reference/branch/PR for LSP4IJ checkout" input box.'
34+
required: true
35+
type: boolean
36+
default: false
3237
refLsp4ij:
33-
description: 'Reference/branch for Lsp4ij checkout'
38+
description: 'Reference/branch/PR for LSP4IJ checkout'
3439
type: string
3540
required: true
3641
default: main
@@ -45,7 +50,48 @@ on:
4550
branches: [ main ]
4651

4752
jobs:
53+
fetch_merge_commit_sha_from_lsp4ij_PR:
54+
runs-on: ubuntu-latest
55+
outputs:
56+
pr_details: ${{ steps.extract.outputs.pr_details }}
57+
checkout_name: ${{ steps.extract.outputs.checkout_name }}
58+
env:
59+
API_URL: https://api.github.com/repos/redhat-developer/lsp4ij/pulls
60+
REF_LSP4IJ: ${{ inputs.refLsp4ij }}
61+
LSP4IJ_BRANCH: ${{ inputs.lsp4ijBranch }}
62+
name: Fetch Commit ${{ inputs.refLsp4ij || '' }}
63+
steps:
64+
- name: Extract Merge Commit SHA
65+
shell: bash
66+
id: extract
67+
run: |
68+
pr_details="${{ env.REF_LSP4IJ }}"
69+
checkout_name="${{ env.LSP4IJ_BRANCH }}"
70+
71+
if [ "${{ inputs.lsp4ijPrNumber }}" == "true" ]; then
72+
url="${{ env.API_URL }}/${{ env.REF_LSP4IJ }}"
73+
pr_detail=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$url")
74+
pr_details=$(jq -r '.merge_commit_sha' <<< "$pr_detail" | xargs)
75+
echo "Merge commit SHA of PR ${{ env.REF_LSP4IJ }}: $pr_details"
76+
checkout_name="${{ env.REF_LSP4IJ }}"
77+
if [[ "$pr_details" == "null" ]]; then
78+
echo "::warning file=::The merge commit SHA of the entered PR is 'null'. Please try again later or use a different PR number."
79+
fi
80+
elif [ -z "$pr_details" ]; then
81+
echo "No LSP4IJ checkout found. Using default case."
82+
elif [ -z "$checkout_name" ]; then
83+
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
84+
checkout_name="${{ env.REF_LSP4IJ }}"
85+
else
86+
echo "Merge Commit SHA/Branch Name/Tag : $pr_details"
87+
fi
88+
89+
# Set output for further steps
90+
echo "pr_details=$pr_details" >> $GITHUB_OUTPUT
91+
echo "checkout_name=$checkout_name" >> $GITHUB_OUTPUT
92+
4893
build:
94+
needs: fetch_merge_commit_sha_from_lsp4ij_PR
4995
runs-on: ${{ matrix.os }}
5096
strategy:
5197
fail-fast: false
@@ -63,8 +109,8 @@ jobs:
63109
reportName: windows-test-report
64110
env:
65111
USE_LOCAL_PLUGIN: ${{ inputs.useLocalPlugin || false }}
66-
REF_LSP4IJ: ${{ inputs.refLsp4ij }}
67-
LSP4IJ_BRANCH: ${{ inputs.lsp4ijBranch || 'default' }}
112+
REF_LSP4IJ: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
113+
LSP4IJ_BRANCH: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
68114
REF_LTI_TAG: ${{ inputs.refLTITag }}
69115
steps:
70116
- name: Configure pagefile
@@ -95,6 +141,7 @@ jobs:
95141
if: ${{ inputs.useLocalPlugin == true }}
96142
working-directory: ./lsp4ij
97143
run: bash ./gradlew buildPlugin
144+
# This step is retained to support the 24.0.9 tag running in the cron job, as it requires an unzipped LSP4IJ.
98145
- name: 'Unzip lsp4ij file'
99146
if: ${{ inputs.useLocalPlugin == true }}
100147
working-directory: ./lsp4ij/build/distributions
@@ -108,7 +155,7 @@ jobs:
108155
if: ${{ runner.os == 'Linux' && !failure() }}
109156
uses: actions/[email protected]
110157
with:
111-
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH }}
158+
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
112159
path: |
113160
./**/*liberty-tools-intellij*.zip
114161
./**/libs/*liberty-tools-intellij*.jar
@@ -122,6 +169,6 @@ jobs:
122169
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
123170
uses: actions/[email protected]
124171
with:
125-
name: ${{ matrix.reportName }}-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH }}
172+
name: ${{ matrix.reportName }}-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
126173
path: |
127174
liberty-tools-intellij/build/reports/

.github/workflows/cronJob.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
fail-fast: false
9696
matrix:
9797
# Existing LTI release tags and branches can be added to obtain build results.If the tag array is empty, it will default to 'main'. However, if there is at least one tag or branch in the tag array and you need to run on 'main' as well, make sure to add 'main' to the array.
98-
tag: [ 'main', '24.0.9', '24.0.12' ] # Can specify tags or branches such as '24.0.6' and 'main'
98+
tag: [ 'main', '24.0.9', '24.0.12-lsp4ijFix' ] # Can specify tags or branches such as '24.0.6' and 'main'
9999
pr_details: ${{ fromJson(needs.fetch_all_pull_request_shas.outputs.pr_details) }}
100100
with:
101101
useLocalPlugin: true
@@ -111,7 +111,7 @@ jobs:
111111
fail-fast: false
112112
matrix:
113113
# Existing LTI release tags and branches can be added to obtain build results.If the tag array is empty, it will default to 'main'. However, if there is at least one tag or branch in the tag array and you need to run on 'main' as well, make sure to add 'main' to the array.
114-
tag: [ 'main', '24.0.9', '24.0.12' ]
114+
tag: [ 'main', '24.0.9', '24.0.12-lsp4ijFix' ]
115115
with:
116116
useLocalPlugin: true
117117
refLsp4ij: main

.github/workflows/pr-slack-notification.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
draft_status="\n*Draft*: true"
106106
fi
107107
108-
pr_list="${pr_list}\n*Pull Request* #${pr_number}: ${pr_title}\n*Created by*: ${pr_user}\n*URL*: ${pr_url}${draft_status}\n*Created At*: ${pr_created_at}\n*Last Updated At*: ${pr_updated_at}\n"
108+
pr_list="${pr_list}\n*Pull Request* ${pr_number}: ${pr_title}\n*Created by*: ${pr_user}\n*URL*: ${pr_url}${draft_status}\n*Created At*: ${pr_created_at}\n*Last Updated At*: ${pr_updated_at}\n"
109109
notify=true
110110
fi
111111
done
@@ -134,14 +134,13 @@ jobs:
134134
135135
echo "Last run timestamp: $last_run_timestamp"
136136
137-
138137
# We used 'sort=updated' to fetch list of closed PRs with max limit of 100(Default value). In the future, we expect to have more than 100 closed PRs, so it's better to keep 'sort=updated'.
139138
closed_prs=$(curl -s -H "Authorization: token ${{ env.GH_TOKEN }}" \
140139
"${{ env.API_URL }}?state=closed&sort=updated&direction=desc&per_page=100")
141140
142141
closed_pr_list=$(echo "$closed_prs" | jq -r \
143142
--arg last_run "$last_run_timestamp" \
144-
'.[] | select(.closed_at > $last_run) | "*Closed Pull Request* #\(.number): \(.title)\n*Closed by*: \(.user.login)\n*URL*: \(.html_url)\n*Closed At*: \(.closed_at)\n"')
143+
'.[] | select(.closed_at > $last_run) | "*Closed Pull Request* \(.number): \(.title)\n*Closed by*: \(.user.login)\n*URL*: \(.html_url)\n*Closed At*: \(.closed_at)\n"')
145144
146145
echo "Closed PR List since last cron job:"
147146
echo "$closed_pr_list"
@@ -169,6 +168,12 @@ jobs:
169168
if [ -f closed_pr_list.txt ]; then
170169
closed_pr_list=$(cat closed_pr_list.txt)
171170
fi
171+
172+
# Prevent Slack from auto-linking issue numbers (e.g., #778) to private channels
173+
# by adding a zero-width space (U+200B) after the `#` symbol.
174+
# This makes the text appear unchanged but prevents unintended Slack formatting.
175+
pr_list=$(echo "$pr_list" | sed 's/#/#​/g')
176+
closed_pr_list=$(echo "$closed_pr_list" | sed 's/#/#​/g')
172177
173178
# Initialize payload blocks
174179
payload_blocks=()

build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version '25.0.1-SNAPSHOT'
1212

1313
def remoteRobotVersion = "0.11.23"
1414
// To switch to nightly version, append "@nightly" to the version number (i.e. 0.4.1-20240828-013108@nightly)
15-
def lsp4ijVersion = '0.8.1'
15+
def lsp4ijVersion = '0.11.0'
1616

1717
allprojects {
1818
sourceCompatibility = javaVersion
@@ -148,10 +148,15 @@ dependencies {
148148
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
149149
bundledPlugins providers.gradleProperty("platformBundledPlugins").orElse("").get().split(',').toList()
150150

151-
def lsp4ij = providers.gradleProperty('useLocal') && providers.gradleProperty('useLocal') == 'true' ?
152-
file("../lsp4ij/build/distributions/LSP4IJ/") :
153-
'com.redhat.devtools.lsp4ij:' + lsp4ijVersion
154-
plugins lsp4ij
151+
// Locate the LSP4IJ ZIP file in the distributions directory
152+
def lsp4ijZip = file("../lsp4ij/build/distributions").listFiles()?.findAll { it.name.endsWith(".zip") }?.first()
153+
154+
// If the 'useLocal' Gradle property is set to 'true', use the locally built LSP4IJ plugin;
155+
// otherwise, use the specified version in the build.gradle file.
156+
providers.gradleProperty("useLocal").get() == 'true' ?
157+
localPlugin(lsp4ijZip.absolutePath) :
158+
plugin('com.redhat.devtools.lsp4ij', lsp4ijVersion)
159+
155160
pluginVerifier()
156161
zipSigner()
157162
instrumentationTools()

docs/LSP4IJ-Continuous-Integration.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The build.yaml workflow is triggered by the following events:
4040
- Workflow Dispatch: Allows manual triggering of the workflow with customizable inputs.
4141

4242

43-
<img alt="Workflow-dispatch" height="300" src="images/Workflow-dispatch.png" width="300" style="display: block; margin: 0 auto;"/>
43+
<img alt="Workflow-dispatch" height="400" src="images/Workflow-dispatch.png" width="300" style="display: block; margin: 0 auto;"/>
4444

4545
To manually trigger the workflow, refer to the [Manually Trigger Workflow](#manually-trigger-workflow) section.
4646

@@ -209,14 +209,23 @@ LSP4IJ nightly builds can be downloaded from the [JetBrains Marketplace](https:/
209209

210210
## Manually Trigger Workflow
211211
To manually trigger the build.yaml workflow , navigate to the [Actions](https://github.com/OpenLiberty/liberty-tools-intellij/actions) tab in the OpenLiberty/liberty-tools-intellij repository. On the left side of the page, select Build Workflow under All workflows. You'll see a message stating, This workflow has a workflow_dispatch event trigger. To the right, there will be a Run workflow button. You can choose the branch from which to run the workflow.
212-
<img alt="Manually-trigger" height="300" src="images/manually-trigger.png" width="300" style="display: block; margin: 0 auto;"/>
212+
213+
<img alt="Manually-trigger" height="350" src="images/manually-trigger.png" width="300" style="display: block; margin: 0 auto;"/>
213214

214215
If you want to use the version of lsp4ij specified in the build.gradle file, there's no need to check the box labeled Use lsp4ij locally. However, if you want to check out a different tag, merge commit SHA, or specific branch of lsp4ij, you can check the box and specify the branch in the provided field. Additionally, you can specify the tag or branch of liberty-tools-intellij to be used.
215216

216217

217218
For example, if you want to trigger the Build Workflow from the `main` branch of the LTI repository and build against version `0.5.0` of LSP4IJ and the `main` branch of LTI, you would configure it as follows:
218219

219-
<img alt="Example" height="300" src="images/example-manually-trigger.png" width="300" style="display: block; margin: 0 auto;"/>
220+
<img alt="Example" height="400" src="images/example-manually-trigger.png" width="300" style="display: block; margin: 0 auto;"/>
221+
222+
If you want to check out LSP4IJ based on a PR number, you can check the box labeled `Run build with an LSP4IJ PR.` and specify the PR number in the provided text field labeled `Reference/branch/PR for LSP4IJ checkout`. Additionally, you can specify the tag or branch of the `liberty-tools-intellij` repository to be used.
223+
224+
> NOTE: Make sure to enable the checkbox labeled `Use lsp4ij locally` as well for this case.
225+
226+
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:
227+
228+
<img alt="Example" height="400" src="images/Allow-developer-to-input-PR-number.png" width="320" style="display: block; margin: 0 auto;"/>
220229

221230
# How to specify LTI tags or branches in CI-CD builds
222231

109 KB
Loading

docs/images/Workflow-dispatch.png

63.6 KB
Loading
67.5 KB
Loading

docs/images/manually-trigger.png

63 KB
Loading

docs/user-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ When installing the Liberty Tools for IntelliJ plugin, the latest version of LSP
5757

5858
If you prefer to use an older version of LSP4IJ (e.g., a specific version that was tested with the Liberty Tools release you are using), you can manually downgrade it by installing the desired version as a dependency from the [JetBrains marketplace](https://plugins.jetbrains.com/plugin/23257-lsp4ij/versions).
5959

60-
| Liberty Tools version | LSP4IJ version(s) tested |
61-
|-----------------------|----------------------------|
62-
| 24.0.9 | 0.5.0, 0.6.0, 0.7.0, 0.8.1 |
63-
| 24.0.12 | 0.8.1, 0.9.0 |
60+
| Liberty Tools version | LSP4IJ version(s) tested |
61+
|-----------------------|------------------------------|
62+
| 24.0.9 | 0.5.0, 0.6.0, 0.7.0, 0.8.1 |
63+
| 24.0.12 | 0.8.1, 0.9.0, 0.10.0, 0.11.0 |
6464

6565

6666
Steps to install an older version of LSP4IJ:

0 commit comments

Comments
 (0)