This is an automated email from the ASF dual-hosted git repository.
thurka pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-vscode.git
The following commit(s) were added to refs/heads/master by this push:
new 64f6b3d github setup
64f6b3d is described below
commit 64f6b3d9c3de9c8b027f3b1d8af29acb5f76a9c0
Author: Tomas Hurka <[email protected]>
AuthorDate: Wed Jul 30 11:37:25 2025 +0200
github setup
---
.github/CONTRIBUTING.md | 24 ++
.github/ISSUE_TEMPLATE/01-netbeans_bug_report.yml | 140 ++++++++++
.../ISSUE_TEMPLATE/02-netbeans_feature_request.yml | 71 +++++
.github/ISSUE_TEMPLATE/99-free_form.yml | 16 ++
.github/ISSUE_TEMPLATE/config.yml | 9 +
.github/PULL_REQUEST_TEMPLATE.md | 28 ++
.github/SECURITY.rst | 35 +++
.github/dependabot.yml | 29 +++
.github/release.yml | 47 ++++
.github/retry.sh | 33 +++
.github/scripts/BinariesListUpdates.java | 158 +++++++++++
.github/scripts/CommitHeaderChecker.java | 166 ++++++++++++
.github/workflows/dependency-checks.yml | 62 +++++
.github/workflows/main.yml | 289 +++++++++++++++++++++
build.xml | 6 +-
15 files changed, 1112 insertions(+), 1 deletion(-)
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 0000000..18cf1ac
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,24 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# Contributing to Apache NetBeans
+
+If you are a first time contributor, please read the [Contribution
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74681408).
diff --git a/.github/ISSUE_TEMPLATE/01-netbeans_bug_report.yml
b/.github/ISSUE_TEMPLATE/01-netbeans_bug_report.yml
new file mode 100644
index 0000000..4fc5554
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/01-netbeans_bug_report.yml
@@ -0,0 +1,140 @@
+---
+name: Apache NetBeans VSCode bug report
+description: Problems and issues with Apache NetBeans VSCode
+labels: ["kind:bug", "needs:triage"]
+body:
+ - type: markdown
+ attributes:
+ # yamllint disable rule:line-length
+ value: "
+ <img
src='https://raw.githubusercontent.com/apache/netbeans/master/nb/ide.branding/release/netbeans.png'
align='left' width='64' height='64'>
+ Thank you for finding the time to report the problem!
+
+ We really appreciate community efforts to improve Apache NetBeans
VSCode.
+
+ Note, that you do not need to create an issue if you have a change
ready to submit!
+
+ You can open a [Pull
Request](https://github.com/apache/netbeans-vscode/pulls) immediately instead.
+ <br clear='left'/>"
+ # yamllint enable rule:line-length
+ - type: dropdown
+ attributes:
+ label: Apache NetBeans VSCode version
+ description: >
+ Which Apache NetBeans VSCode version are you using? Only the latest
release, latest
+ release candidate (if available), and latest daily build are supported
for bugs.
+ If using an older version, please verify the bug is still valid before
reporting.
+ multiple: false
+ options:
+ - "Apache NetBeans VSCode 26"
+ - "Apache NetBeans VSCode 27 latest release candidate"
+ - "Apache NetBeans VSCode 28 latest daily build"
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: What happened
+ description: Describe what happened, what you expected to happen, and
what went wrong.
+ placeholder: >
+ Please provide the context in which the problem occurred and explain
what happened.
+ Explain why you think the behaviour is erroneous. It is extremely
helpful if you attach the messages.log file or copy&paste
+ the fragment of logs showing the exact error messages or wrong
behaviour and screenshots for
+ UI problems or YouTube link to a video of you demonstrating the
problem. You can include files by
+ dragging and dropping them here.
+ validations:
+ required: true
+ - type: input
+ attributes:
+ label: Language / Project Type / NetBeans Component
+ description: >
+ Narrow down the specific area, examples: 'Java Maven Web application
project'.
+ placeholder: "Java Maven Project using Java Modules (JPMS)"
+ - type: textarea
+ attributes:
+ label: How to reproduce
+ description: >
+ What should we do to reproduce the problem? If you are not able to
provide a reproducible case,
+ please open a
[Discussion](https://github.com/apache/netbeans-vscode/discussions) instead.
+ placeholder: >
+ Please make sure you provide a reproducible step-by-step case of how
to reproduce the problem
+ as minimally and precisely as possible. Remember that non-reproducible
issues may be closed or
+ converted into discussions. If we cannot reproduce an issue we cannot
fix it!
+ validations:
+ required: true
+ - type: dropdown
+ attributes:
+ label: Did this work correctly in an earlier version?
+ description: >
+ It's important to know whether bugs have been introduced by recent
changes. If this used
+ to work, select the last version that worked correctly from the list.
Older versions can be
+ specified in the description.
+ multiple: false
+ options:
+ - "No / Don't know"
+ - "Apache NetBeans VSCode 27"
+ - "Apache NetBeans VSCode 26"
+ - "Apache NetBeans VSCode 25"
+ - "Apache NetBeans VSCode 24"
+ - "Apache NetBeans VSCode 23 or earlier"
+ validations:
+ required: true
+ - type: input
+ attributes:
+ label: Operating System
+ description: What Operating System are you using?
+ placeholder: "Please be as specific as you can - version, distribution,
architecture, etc."
+ validations:
+ required: true
+ - type: input
+ attributes:
+ label: JDK
+ description: Which JDK are you using?
+ placeholder: "Please be as specific as you can - version, distribution,
architecture, etc."
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Anything else
+ description: Anything else we need to know?
+ placeholder: >
+ How often does this problem occur? (Once? Every time? Only when
certain conditions are met?)
+ Any relevant logs to include? Put them here inside fenced
+ ``` ``` blocks or inside a foldable details tag if it's long:
+ <details><summary>x.log</summary> lots of stuff </details>
+
+ Tip: You can attach images or log files by clicking this area to
highlight it and then dragging files in.
+ - type: dropdown
+ attributes:
+ label: Are you willing to submit a pull request?
+ description: >
+ This is absolutely not required, but we are happy to guide you in the
contribution process,
+ especially if you already have a good understanding of how to
implement the fix. <br>
+ Apache NetBeans VSCode is a community-managed project and we love to
bring new contributors in.
+ options:
+ - "No"
+ - "Yes"
+ validations:
+ required: true
+# - type: dropdown
+# attributes:
+# label: Code of Conduct
+# description: >
+# The Code of Conduct helps create a safe space for everyone.
+# I agree to follow the Apache Software Foundation's
+# [Code of
Conduct](https://www.apache.org/foundation/policies/conduct.html)
+# options:
+# - "Yes"
+# validations:
+# required: true
+# - type: markdown
+# attributes:
+# value: "Thank you for completing our form!"
+ - type: markdown
+ attributes:
+ value: "**By submitting this form you agree to follow the Apache
Software Foundation's
+ [Code of
Conduct](https://www.apache.org/foundation/policies/conduct.html)**.
+
+ The Code of Conduct helps create a safe space for everyone.
+
+
+ Thank you for completing our form!"
diff --git a/.github/ISSUE_TEMPLATE/02-netbeans_feature_request.yml
b/.github/ISSUE_TEMPLATE/02-netbeans_feature_request.yml
new file mode 100644
index 0000000..da7b326
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/02-netbeans_feature_request.yml
@@ -0,0 +1,71 @@
+---
+name: Apache NetBeans VSCode feature request
+description: Suggest an idea to improve Apache NetBeans VSCode
+labels: ["kind:feature", "needs:triage"]
+body:
+ - type: markdown
+ attributes:
+ # yamllint disable rule:line-length
+ value: "
+ <img
src='https://raw.githubusercontent.com/apache/netbeans/master/nb/ide.branding/release/netbeans.png'
align='left' width='64' height='64'>
+ Thank you for finding the time to propose a new feature!
+
+ We really appreciate community efforts to improve Apache NetBeans.
+
+ Note, that you do not need to create an issue if you have a change
ready to submit!
+
+ You can open a [Pull
Request](https://github.com/apache/netbeans-vscode/pulls) immediately instead.
+ <br clear='left'/>"
+ # yamllint enable rule:line-length
+ - type: textarea
+ attributes:
+ label: Description
+ description: A short description of your feature
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Use case/motivation
+ description: What do you want to happen?
+ placeholder: >
+ Rather than telling us how you might implement this feature, try to
take a
+ step back and describe what you are trying to achieve.
+ - type: textarea
+ attributes:
+ label: Related issues
+ description: Is there currently another issue associated with this?
+ - type: dropdown
+ attributes:
+ label: Are you willing to submit a pull request?
+ description: >
+ This is absolutely not required, but we are happy to guide you in the
contribution process,
+ especially if you already have a good understanding of how to
implement the fix. <br>
+ Apache NetBeans is a community-managed project and we love to bring
new contributors in.
+ options:
+ - "No"
+ - "Yes"
+ validations:
+ required: true
+# - type: dropdown
+# attributes:
+# label: Code of Conduct
+# description: >
+# The Code of Conduct helps create a safe space for everyone.
+# I agree to follow the Apache Software Foundation's
+# [Code of
Conduct](https://www.apache.org/foundation/policies/conduct.html)
+# options:
+# - "Yes"
+# validations:
+# required: true
+# - type: markdown
+# attributes:
+# value: "Thank you for completing our form!"
+ - type: markdown
+ attributes:
+ value: "**By submitting this form you agree to follow the Apache
Software Foundation's
+ [Code of
Conduct](https://www.apache.org/foundation/policies/conduct.html)**.
+
+ The Code of Conduct helps create a safe space for everyone.
+
+
+ Thank you for completing our form!"
diff --git a/.github/ISSUE_TEMPLATE/99-free_form.yml
b/.github/ISSUE_TEMPLATE/99-free_form.yml
new file mode 100644
index 0000000..2754e88
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/99-free_form.yml
@@ -0,0 +1,16 @@
+---
+name: Task and Meta
+description: (Maintainers only) Tasks and Meta issues for the project
+labels: ["kind:meta"]
+body:
+ - type: textarea
+ attributes:
+ label: Body
+ description: Free form issue for committers to be able to add tasks/meta
issues
+ - type: checkboxes
+ attributes:
+ label: Committer
+ description: Committer acknowledgment.
+ options:
+ - label: I acknowledge that I am a maintainer/committer in the Apache
NetBeans VSCode project.
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml
b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..f1b55b9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,9 @@
+---
+blank_issues_enabled: false
+contact_links:
+ - name: Ask a question (GitHub Discussions)
+ url: https://github.com/apache/netbeans-vscode/discussions/
+ about: Ask a question or request support for using Apache NetBeans VSCode.
+ - name: Mailing lists
+ url: https://netbeans.apache.org/community/mailing-lists
+ about: Subscribe to the users, dev or announce mailing lists for Apache
NetBeans.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..ce5cdba
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,28 @@
+
+
+
+
+---
+**^Add meaningful description above**
+
+<details open>
+<summary>Click to collapse/expand PR instructions</summary>
+
+By opening a pull request you confirm that, unless explicitly stated
otherwise, the changes -
+
+ - are all your own work, and you have the right to contribute them.
+ - are contributed solely under the terms and conditions of the Apache License
2.0 (see section 5 of the license for more information).
+
+Please make sure (eg. `git log`) that all commits have a valid name and email
address for you in the Author field.
+
+If you're a first time contributor, see the Contributing guidelines for more
information.
+
+If you're a committer, please label the PR before pressing "Create pull
request" so that the right test jobs can run.
+
+### PR approval and merge checklist:
+
+1. [ ] Is this PR
[squashed](https://cwiki.apache.org/confluence/display/NETBEANS/git%3A+squash+and+merge)?
+2. [ ] Are author name / email address correct? Are
[co-authors](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line)
correctly listed? Do the commit messages need updates?
+3. [ ] Does the PR title and description still fit after the Nth iteration? Is
the description sufficient to appear in the release notes?
+
+</details>
diff --git a/.github/SECURITY.rst b/.github/SECURITY.rst
new file mode 100644
index 0000000..d95b213
--- /dev/null
+++ b/.github/SECURITY.rst
@@ -0,0 +1,35 @@
+ .. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ .. http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+Reporting Vulnerabilities
+-------------------------
+
+**⚠️ Please do not file GitHub issues for security vulnerabilities as they are
public! ⚠️**
+
+The Apache Software Foundation takes security issues very seriously. If you
have any
+concern around Apache NetBeans security or believe you have uncovered a
vulnerability,
+we suggest that you get in touch via the e-mail address [email protected].
In the
+message, try to provide a description of the issue and ideally a way of
reproducing it.
+The security team will get back to you after assessing the description. Please
do not
+discuss the vulnerability publicly until we've had time to assess and address.
+
+Note that this security address should be used only for undisclosed
vulnerabilities.
+Dealing with fixed issues or general questions on use should be handled via the
+user and dev mailing lists.
+
+The `ASF Security team's page <https://www.apache.org/security/>`_ describes
how
+vulnerability reports are handled, and includes PGP keys if you wish to use
that.
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..0b06984
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+version: 2
+updates:
+
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
+ labels:
+ - "Upgrade Library"
+ - "CI"
+
+# for project dependencies see .github/workflows/dependency-checks.yml
diff --git a/.github/release.yml b/.github/release.yml
new file mode 100644
index 0000000..ec2e889
--- /dev/null
+++ b/.github/release.yml
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+
+# doc:
https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options
+changelog:
+
+ exclude:
+
+ labels:
+ - 'Release process'
+ - 'ci:no-build'
+
+ # order matters since this works like a filter, a PR will show up only once.
+ # try to keep similar categories together since this is also the rendering
order.
+ categories:
+
+ - title: 'Language Server Protocol'
+ labels:
+ - 'LSP'
+
+ - title: 'VSCode Extension'
+ labels:
+ - 'VSCode Extension'
+
+ - title: 'Maintenance'
+ labels:
+ - 'Code cleanup'
+ - 'Upgrade Library'
+ - 'dependencies'
+ - 'CI'
+
+ - title: Other Changes
+ labels:
+ - "*"
diff --git a/.github/retry.sh b/.github/retry.sh
new file mode 100755
index 0000000..a336781
--- /dev/null
+++ b/.github/retry.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+TEST=$(getopt -q -a "f:" $@ | cut -d ' ' -f3)
+{
+ $@
+} || {
+ echo "::warning::$TEST failed: starting retry 1"
+ echo "::group::retry 1" && $@ && echo "::endgroup::"
+} || {
+ echo "::endgroup::"
+ echo "::warning::$TEST failed: starting retry 2"
+ echo "::group::retry 2" && $@ && echo "::endgroup::"
+} || {
+ echo "::endgroup::"
+ exit 1
+}
diff --git a/.github/scripts/BinariesListUpdates.java
b/.github/scripts/BinariesListUpdates.java
new file mode 100644
index 0000000..444760d
--- /dev/null
+++ b/.github/scripts/BinariesListUpdates.java
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.atomic.LongAdder;
+import java.util.stream.Stream;
+import org.apache.maven.search.api.Record;
+import org.apache.maven.search.api.SearchRequest;
+import org.apache.maven.search.backend.smo.SmoSearchBackend;
+import org.apache.maven.search.backend.smo.SmoSearchBackendFactory;
+import org.apache.maven.artifact.versioning.ComparableVersion;
+
+import static org.apache.maven.search.api.MAVEN.ARTIFACT_ID;
+import static org.apache.maven.search.api.MAVEN.CLASSIFIER;
+import static org.apache.maven.search.api.MAVEN.GROUP_ID;
+import static org.apache.maven.search.api.MAVEN.VERSION;
+import static org.apache.maven.search.api.request.BooleanQuery.and;
+import static org.apache.maven.search.api.request.FieldQuery.fieldQuery;
+
+/**
+ * Scans for binaries-list files and checks if newer versions of the declared
dependencies exist.
+ *
+ * dependencies:
+ * <pre>org.apache.maven.indexer:search-backend-smo</pre>
+ * <pre>org.apache.maven:maven-artifact</pre>
+ *
+ * @author mbien
+ */
+public class BinariesListUpdates {
+
+ private static final LongAdder updates = new LongAdder();
+ private static final LongAdder checks = new LongAdder();
+ private static final LongAdder skips = new LongAdder();
+
+ // java --class-path "lib/*" BinariesListUpdates.java
/path/to/netbeans/project
+ public static void main(String[] args) throws IOException,
InterruptedException {
+
+ if (args.length != 1 ||
Files.notExists(Path.of(args[0]).resolve("README.md"))) {
+ throw new IllegalArgumentException("path to netbeans folder
expected");
+ }
+
+ Path path = Path.of(args[0]);
+ try (Stream<Path> dependencyFiles = Files.find(path, 10, (p, a) ->
p.getFileName().toString().equals("binaries-list"));
+ SmoSearchBackend backend =
SmoSearchBackendFactory.createDefault()) {
+ dependencyFiles.sorted().forEach(p -> {
+ try {
+ checkDependencies(p, backend);
+ } catch (IOException | InterruptedException ex) {
+ throw new RuntimeException(ex);
+ }
+ });
+ }
+
+ System.out.println("checked " + checks.sum() + " dependencies, found "
+ updates.sum() + " updates, skipped " + skips.sum() + "." );
+ }
+
+ private static void checkDependencies(Path path, SmoSearchBackend backend)
throws IOException, InterruptedException {
+ System.out.println(path);
+ try (Stream<String> lines = Files.lines(path).parallel()) {
+
+ // 321C614F85F1DEA6BB08C1817C60D53B7F3552FD
org.fusesource.jansi:jansi:2.4.0
+ lines.filter(l -> !l.startsWith("#"))
+ .filter(l -> l.length() > 40 && l.charAt(40) == ' ')
+ .map(l -> l.substring(40+1))
+ .forEach(l -> {
+
+ String[] comp = l.split("\\:");
+ if (comp.length == 3 || comp.length == 4) {
+ String gid = comp[0].strip();
+ String aid = comp[1].strip();
+ String version = comp[2].strip();
+ String classifier = comp.length == 4 ? comp[3].strip() :
null;
+ try {
+ String gac;
+ String latest;
+ if (classifier == null) {
+ latest = queryLatestVersion(backend, gid, aid);
+ gac = String.join(":", gid, aid);
+ } else {
+ latest = queryLatestVersion(backend, gid, aid,
classifier.split("@")[0]);
+ gac = String.join(":", gid, aid, classifier);
+ }
+ if (latest != null && !version.equals(latest)) {
+ System.out.printf(" %-50s %s -> %s\n", gac,
version, latest);
+ updates.increment();
+ }
+ } catch (IOException | InterruptedException ex) {
+ throw new RuntimeException(ex);
+ }
+ } else {
+ System.out.println(" skip: '"+l+"'");
+ skips.increment();
+ }
+ checks.increment();
+ });
+ }
+ System.out.println();
+ }
+
+ private static String queryLatestVersion(SmoSearchBackend backend, String
gid, String aid) throws IOException, InterruptedException {
+ return queryLatestVersion(backend, new
SearchRequest(and(fieldQuery(GROUP_ID, gid), fieldQuery(ARTIFACT_ID, aid))));
+ }
+
+ private static String queryLatestVersion(SmoSearchBackend backend, String
gid, String aid, String classifier) throws IOException, InterruptedException {
+ return queryLatestVersion(backend, new
SearchRequest(and(fieldQuery(GROUP_ID, gid), fieldQuery(ARTIFACT_ID, aid),
fieldQuery(CLASSIFIER, classifier))));
+ }
+
+ // reduce concurrency level if needed
+ private final static Semaphore requests = new Semaphore(4);
+
+ private static String queryLatestVersion(SmoSearchBackend backend,
SearchRequest request) throws IOException, InterruptedException {
+ requests.acquire();
+ try {
+ List<Record> results;
+ try {
+ results = backend.search(request).getPage();
+ } catch (IOException ex) {
+ System.out.println("received exception: '" + ex.getMessage() +
"', retry in 10s");
+ Thread.sleep(10_000);
+ try {
+ results = backend.search(request).getPage();
+ } catch(IOException ignore) {
+ throw ex;
+ }
+ }
+ return results.stream()
+ .map(r -> r.getValue(VERSION))
+ .filter(v -> !v.contains("alpha") && !v.contains("beta"))
+ .filter(v -> !v.contains("M") && !v.contains("m") &&
!v.contains("B") && !v.contains("b") && !v.contains("ea") && !v.contains("RC"))
+ .limit(5)
+ .max((v1, v2) -> new ComparableVersion(v1).compareTo(new
ComparableVersion(v2)))
+ .orElse(null);
+ } finally {
+ requests.release();
+ }
+ }
+
+}
diff --git a/.github/scripts/CommitHeaderChecker.java
b/.github/scripts/CommitHeaderChecker.java
new file mode 100644
index 0000000..ae0e95e
--- /dev/null
+++ b/.github/scripts/CommitHeaderChecker.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpClient.Redirect;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse.BodyHandlers;
+import java.time.Duration;
+import java.util.List;
+
+import static java.util.stream.Gatherers.fold;
+import static java.util.stream.Gatherers.scan;
+import static java.util.stream.Gatherers.windowSliding;
+
+record Commit(int index, String from, String date, String subject, String
blank) {}
+record Result(int total, boolean green) {}
+
+// checks commit headers for valid author, email and commit msg formatting
+// its main purpose is to prevent common merge mistakes
+
+// Java 25+
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/${{
github.event.pull_request.number }}
+
+// green tests:
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/66
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/7641
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/4138
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/4692
+
+// red tests:
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/7776
+// java CommitHeaderChecker.java https://github.com/apache/netbeans/pull/5567
+
+void main(String[] args) throws IOException, InterruptedException {
+
+ if (args.length != 1 || !args[0].startsWith("https://github.com/")) {
+ throw new IllegalArgumentException("PR URL expected");
+ }
+
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create(args[0]+".patch"))
+ .timeout(Duration.ofSeconds(10))
+ .build();
+
+ log("checking PR patch file...");
+ Result result;
+ try (HttpClient client = HttpClient.newBuilder()
+ .followRedirects(Redirect.NORMAL).build()) {
+
+ result = client.send(request, BodyHandlers.ofLines()).body()
+ // 5 line window, From/Date/Subject and extra line for blank line
/ overflow check
+ // "From" can be two lines if the name is very long
+ .gather(windowSliding(5))
+ .filter(w -> isCommitHeader(w))
+ .gather(scan(
+ () -> new Commit(-1, "", "", "", ""),
+ (c, w) -> createCommit(c.index+1, w)))
+ .peek(System.out::println)
+ .gather(fold(
+ () -> new Result(0, true),
+ (r, c) -> new Result(r.total+1, r.green & checkCommit(c))))
+ .findFirst()
+ .orElseThrow();
+ }
+
+ log(result.total + " commit(s) checked");
+ System.exit(result.green ? 0 : 1);
+}
+
+// From: Duke <[email protected]>
+// Date: Thu, 1 Oct 2024 22:10:50 -0700
+// Subject: [PATCH] Mail Validator
+private static boolean isCommitHeader(List<String> lines) {
+ int i = 0;
+ return lines.size() == 5
+ && lines.get(i++).startsWith("From: ") // "From" can be two lines in
some cases
+ &&(lines.get(i++).startsWith("Date: ") ||
lines.get(i++).startsWith("Date: "))
+ && lines.get(i++).startsWith("Subject: ");
+}
+
+private static Commit createCommit(int index, List<String> lines) {
+ int i = 0;
+ return lines.get(1).startsWith("Date: ") // "From" can be two lines in
some cases
+ ? new Commit(index, lines.get(i++), lines.get(i++), lines.get(i++),
lines.get(i++))
+ : new Commit(index, lines.get(i++) + lines.get(i++), lines.get(i++),
lines.get(i++), lines.get(i++));
+}
+
+boolean checkCommit(Commit c) {
+ return checkNameAndEmail(c.index, c.from)
+ & checkSubject(c.index, c.subject)
+ & checkBlankLineAfterSubject(c.index, c.blank);
+}
+
+boolean checkNameAndEmail(int i, String from) {
+ // From: Duke <[email protected]>
+ int start = from.indexOf('<');
+ int end = from.indexOf('>');
+
+ String mail = end > start ? from.substring(start+1, end) : "";
+ String author = start > 6 ? from.substring(6, start).strip() : "";
+
+ // bots may pass
+ if (author.contains("[bot]")) {
+ return true;
+ }
+
+ boolean green = true;
+ if (mail.isBlank() || !mail.contains("@") || mail.contains("noreply") ||
mail.contains("localhost")) {
+ log("::error::invalid email in commit " + i + " '" + from + "'");
+ green = false;
+ }
+
+ // mime encoding indicates it is probably a proper name, since gh account
names aren't encoded
+ boolean encoded = author.startsWith("=?") && author.endsWith("?=");
+
+ // single word author -> probably the nickname/account name/root etc
+ if (author.isBlank() || (!encoded && !author.contains(" ") &&
!author.contains("-"))) {
+ log("::error::invalid author in commit " + i + " '" + author + "'
(full name?)");
+ green = false;
+ }
+ return green;
+}
+
+//
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-commit.html#_discussion
+boolean checkSubject(int i, String subject) {
+ // Subject: [PATCH] msg
+ subject = subject.substring(subject.indexOf(']')+1).strip();
+ // single word subjects are likely not intended or should be squashed
before merge
+ if (!subject.contains(" ")) {
+ log("::error::invalid subject in commit " + i + " '" + subject + "'");
+ return false;
+ }
+ return true;
+}
+
+// there should be a blank line after the subject line, some subjects can
overflow though.
+boolean checkBlankLineAfterSubject(int i, String blank) {
+// disabled since this would produce too many warnings due to overflowing
subject lines
+// if (!blank.isBlank()) {
+// log("::warning::blank line after subject recommended in commit " + i
+ " (is subject over 50 char limit?)");
+// // return false;
+// }
+ return true;
+}
+
+void log(String msg) {
+ System.out.println(msg);
+}
diff --git a/.github/workflows/dependency-checks.yml
b/.github/workflows/dependency-checks.yml
new file mode 100644
index 0000000..cbd221a
--- /dev/null
+++ b/.github/workflows/dependency-checks.yml
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: NetBeans VSCode Dependency Checks
+
+on:
+# pull_request:
+ # Allows you to run this workflow manually from the Actions tab in GitHub UI
+ workflow_dispatch:
+
+# cancel other workflow run in the same head-base group if it exists
+concurrency:
+ group: dep-checker-${{ github.head_ref || github.run_id }}-${{
github.base_ref }}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+
+ base-build:
+ name: Check Dependencies
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ steps:
+
+ - name: Checkout ${{ github.ref }} ( ${{ github.sha }} )
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ submodules: false
+ show-progress: false
+
+ - name: Set up JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: 21
+ distribution: 'zulu'
+
+ - name: Check Dependencies
+ run: |
+
DEPS=org.apache.maven:maven-artifact:3.9.9,org.apache.maven.indexer:search-backend-smo:7.1.5
+ mvn eu.maveniverse.maven.plugins:toolbox:gav-copy-transitive
-Dgav=$DEPS -DsinkSpec="flat(./lib)"
+ echo "<pre>" >> $GITHUB_STEP_SUMMARY
+ java -cp "lib/*" .github/scripts/BinariesListUpdates.java ./ | tee
-a $GITHUB_STEP_SUMMARY
+ echo "</pre>" >> $GITHUB_STEP_SUMMARY
+ rm -Rf lib
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..541e371
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,289 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# https://infra.apache.org/github-actions-policy.html
+# actions:
+# - github actions use the latest release within the locked major version
+# - third party actions (geekyeggo/delete-artifact, test-summary/action and
shivammathur/setup-ph) shall be locked to a hash
+# - see
https://github.com/apache/infrastructure-gha-allowlist-manager/blob/main/approved_patterns.yml
+# - dependabot is active to keep them up to date
+#
+# this workflow can push the limit of the apache action runner policy, please
use CI responsibly
+
+name: NetBeans VSCode
+
+on:
+ push:
+ branches:
+ - 'master'
+ - 'release*'
+
+ pull_request:
+ # unlocked event is used as super secret restart button
+ types: [opened, synchronize, unlocked]
+
+ # Allows you to run this workflow manually from the Actions tab in GitHub UI
+ # keep in mind this will have ALL tests enabled
+ workflow_dispatch:
+
+# cancel other PR workflow run in the same head-base group if it exists (e.g.
during PR syncs)
+# if this is not a PR run (no github.head_ref and github.base_ref defined),
use an UID as group
+concurrency:
+ group: ${{ github.head_ref || github.run_id }}-${{ github.base_ref }}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ shell: bash
+
+env:
+
+ # note to self: don't remove the minus again
+ OPTS: >-
+ -Dtest-unit-sys-prop.ignore.random.failures=true
+
+ # what to build and test, see nbbuild/cluster.properties
+ CLUSTER_CONFIG: 'full'
+
+ # default java distribution used by the setup-java action across jobs
+ # see https://github.com/actions/setup-java#supported-distributions
+ # CI requirements:
+ # - timely GA releases (no delays if possible)
+ # - EA builds must be available for the upcoming release (note: some
vendors skip builds)
+ # - linux, win, mac (arm)
+ # - reliable / no extra sauce
+ DEFAULT_JAVA_DISTRIBUTION: 'temurin'
+
+ # labels are mapped to env vars for pipeline customization. If this is not a
PR, (almost) everything will run, but with a reduced matrix.
+ # note: env vars don't work in the job's 'if' field but do work within jobs
( https://github.com/actions/runner/issues/1189 ), the whole expression must be
duplicated
+
+ # labels for special commands:
+ # 'ci:all-tests' enables everything
+ # 'ci:no-build' disables the build job (and test jobs too)
+ # 'ci:dev-build' produces an artifact containing a runnable NetBeans zip
distribution
+
+ # 'VSCode Extension' label for building and testing the VSCode Extension
+ test_vscode_extension: ${{ contains(github.event.pull_request.labels.*.name,
'VSCode Extension') || contains(github.event.pull_request.labels.*.name,
'ci:all-tests') || github.event_name != 'pull_request' }}
+
+
+jobs:
+
+ # primary build job, most other jobs use the artifact produced here
+ # artifact is only produced once in the matrix
+ base-build:
+ name: Build VSCode on JDK ${{ matrix.java }}
+ if: contains(github.event.pull_request.labels.*.name, 'ci:no-build') ==
false
+ runs-on: ubuntu-latest
+ timeout-minutes: 40
+ strategy:
+ matrix:
+ java: [ '17', '21' ]
+ exclude:
+ - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21'
}}
+ fail-fast: false
+ steps:
+
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
+
+ - name: Checkout ${{ github.ref }} ( ${{ github.sha }} )
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ submodules: true
+ show-progress: false
+
+ - name: Caching dependencies
+ uses: actions/cache@v4
+ with:
+ path: ~/.hgexternalcache
+ key: ${{ runner.os }}-${{
hashFiles('netbeans/*/external/binaries-list',
'netbeans/*/*/external/binaries-list') }}
+ restore-keys: ${{ runner.os }}-
+
+ - name: Build NetBeans
+ run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG build-netbeans
+
+ - name: Prepare Artifact
+ if: ${{ matrix.java == '17' }}
+ run: tar -I 'zstd -9 -T0' -cf /tmp/build.tar.zst --exclude ".git" .
+
+ - name: Upload Workspace
+ if: ${{ (matrix.java == '17') && success() }}
+ uses: actions/upload-artifact@v4
+ with:
+ name: build
+ path: /tmp/build.tar.zst
+ compression-level: 0
+ retention-days: 2
+ if-no-files-found: error
+
+ - name: Create Dev Build
+ if: ${{ matrix.java == '17' &&
contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success()
}}
+ run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG
zip-cluster-config
+
+ - name: Upload Dev Build
+ if: ${{ matrix.java == '17' &&
contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success()
}}
+ uses: actions/upload-artifact@v4
+ with:
+ name: dev-build_${{github.event.pull_request.number ||
github.run_id}}
+ path: nbbuild/NetBeans-*.zip
+ compression-level: 0
+ retention-days: 7
+ if-no-files-found: error
+
+
+ build-from-src-zip:
+ name: Build ${{ matrix.config }} from src.zip on JDK ${{ matrix.java }}
+ # equals env.test_platform == 'true' || test_vscode_extension == 'true'
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'Platform') ||
contains(github.event.pull_request.labels.*.name, 'VSCode Extension') ||
contains(github.event.pull_request.labels.*.name, 'ci:all-tests') ||
github.event_name != 'pull_request' }}
+ needs: base-build
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ matrix:
+ java: [ '17' ]
+ config: [ 'release' ]
+ fail-fast: false
+ steps:
+
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
+
+ - name: Download Build
+ uses: actions/download-artifact@v4
+ with:
+ name: build
+
+ - name: Extract
+ run: tar --zstd -xf build.tar.zst
+
+ - name: Restoring Cache
+ uses: actions/cache/restore@v4
+ with:
+ path: ~/.hgexternalcache
+ key: ${{ runner.os }}-${{
hashFiles('netbeans/*/external/binaries-list',
'netbeans/*/*/external/binaries-list') }}
+ restore-keys: ${{ runner.os }}-
+
+ - name: Create ${{ matrix.config }}-src zip
+ run: ant $OPTS -quiet build-source-config -Dcluster.config=${{
matrix.config }} -Dmetabuild.branch=master
-Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/refs/heads/master/meta/netbeansvscode.json
-Dmetabuild.RawVersion=dev
+
+ - name: Extract ${{ matrix.config }}-src zip
+ run: |
+ mkdir tmpbuild && cd tmpbuild
+ unzip -qq ../build/${{ matrix.config }}-src*
+
+ - name: Build from ${{ matrix.config }}-src zip
+ run: |
+ cd tmpbuild
+ ant $OPTS -quiet build-netbeans -Dcluster.config=${{ matrix.config }}
+
+ # extra round for VSCodeExt which is built with 'release' config
+ - name: Set up node
+ if: ${{ (matrix.config == 'release') && success() }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20.18.1
+
+ - name: Build NBVSCodeExt from ${{ matrix.config }}-src zip
+ if: ${{ (matrix.config == 'release') && success() }}
+ run: |
+ cd tmpbuild
+ ant $OPTS -quiet build-vscode-ext -D3rdparty.modules=none
+
+
+ vscode-extension-test:
+ name: VSCode Extension Tests on JDK ${{ matrix.java }}
+ # equals env.test_vscode_extension == 'true'
+ # if: ${{ contains(github.event.pull_request.labels.*.name, 'VSCode
Extension') || contains(github.event.pull_request.labels.*.name,
'ci:all-tests') || github.event_name != 'pull_request' }}
+ needs: base-build
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ matrix:
+ java: [ '17' ]
+ fail-fast: false
+
+ steps:
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
+
+ - name: Set up node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20.18.1
+
+ - name: Setup Xvfb
+ run: |
+ echo "DISPLAY=:99.0" >> $GITHUB_ENV
+ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
+
+ - name: Download Build
+ uses: actions/download-artifact@v4
+ with:
+ name: build
+
+ - name: Extract
+ run: tar --zstd -xf build.tar.zst
+
+ - name: build-vscode-ext
+ run: |
+ ant $OPTS build-vscode-ext
+
+ - name: test-vscode-ext
+ run: |
+ env "netbeans.extra.options=-J-Dnetbeans.logger.console=true" ant
$OPTS test-vscode-ext
+
+
+# cleanup job depends on everything so that it is forced to run last even if a
long job fails early.
+# 'paperwork' is left out intentionally, since it doesn't run unit tests
(hopefully doesn't need restarts)
+# and shouldn't prevent cleanup on validation failure - which might be common
during dev time
+ cleanup:
+ name: Cleanup Workflow Artifacts
+ needs:
+ - base-build
+ - build-from-src-zip
+ - vscode-extension-test
+
+ # cleanup if the primary build job succeeded and
+ # * nothing else failed (allows manual restarts)
+ # * the workflow got cancelled
+ if: ${{ always() && needs.base-build.result == 'success' &&
(!contains(needs.*.result, 'failure') || cancelled()) }}
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ steps:
+
+ - name: Delete Workspace Artifact
+ uses:
geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
+ with:
+ name: build
+ useGlob: false
+
+ - name: Delete Dev Build Artifact
+ uses:
geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
+ if: ${{ contains(github.event.pull_request.labels.*.name,
'ci:dev-build') && cancelled() }}
+ with:
+ name: dev-build_${{github.event.pull_request.number ||
github.run_id}}
+ useGlob: false
diff --git a/build.xml b/build.xml
index 12aeda3..d4e58de 100644
--- a/build.xml
+++ b/build.xml
@@ -170,7 +170,11 @@
<zip
destfile="${vsc.build.dir}/apache-netbeans-java-${vsix.version}.vsix"
basedir="${vsc.build.dir}/vscode-mandatory/" update="true" />
</target>
<target name="test-lsp-server" description="Tests the LSP server behavior">
- <ant dir="nbcode" target="test" inheritall="false" inheritrefs="false"
/>
+ <ant dir="nbcode" target="test" inheritall="false" inheritrefs="false">
+ <property name="nbplatform.default.netbeans.dest.dir"
location="${nbplatform.default.netbeans.dest.dir}" />
+ <property name="nbplatform.default.harness.dir"
location="${nbplatform.default.harness.dir}" />
+ <property name="nbantext.jar" location="${nbantext.jar}" />
+ </ant>
</target>
<target name="int-default" description="Bootstrap netbeans">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists