Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,21 @@ jobs:
run: |
mkdir -p _site/grammar
cp /tmp/rrd-antlr4/target/output/VeLa/index.html _site/grammar/VeLa.html
- name: Commit and push VeLa grammar diagram to gh-pages
- name: Deploy plugins to gh-pages (snapshot)
run: |
mkdir -p _site/plugins/snapshot
unzip -q plugin/vstar-plugins.zip -d _site/plugins/snapshot/
- name: Commit and push to gh-pages
working-directory: _site
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add grammar/VeLa.html
git add -A
if git diff --cached --quiet; then
echo "No VeLa grammar diagram changes to publish."
echo "No changes to publish."
exit 0
fi
git commit -m "Update VeLa grammar railroad diagram"
git commit -m "Update VeLa grammar diagram and snapshot plugins"
for i in 1 2 3; do
git pull --rebase origin gh-pages && git push origin gh-pages && break
echo "Push attempt $i failed, retrying in $((i * 5))s..."
Expand All @@ -103,4 +107,3 @@ jobs:
files: |
vstar-bash.zip
vstar-win.zip
plugin/vstar-plugins.zip
70 changes: 70 additions & 0 deletions .github/workflows/stable-plugin-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow builds the VStar plugins for a stable release and deploys
# them to gh-pages under plugins/<version>/.
#
# Triggered by pushing a version tag of the form <major>.<minor>.<patch>,
# e.g. git tag 2.25.0 && git push origin 2.25.0
# Can also be triggered manually via workflow_dispatch with a version input.
#
# See: https://github.com/AAVSO/VStar/issues/589

name: Stable Plugin Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

name: Stable plugin release

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Get version
id: version
run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
- name: Create plugin dir
run: mkdir -p ~/vstar_plugins
- name: Create plugin libs dir
run: mkdir -p ~/vstar_plugin_libs
- name: Build plugins archive
run: |
cd plugin
ant -noinput -buildfile build.xml aavso
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: _site
- name: Deploy plugins to gh-pages
run: |
VERSION=${{ steps.version.outputs.version }}
mkdir -p _site/plugins/$VERSION
unzip -q plugin/vstar-plugins.zip -d _site/plugins/$VERSION/
- name: Commit and push plugins to gh-pages
working-directory: _site
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -A
if git diff --cached --quiet; then
echo "No plugin changes to publish."
exit 0
fi
git commit -m "Deploy plugins for ${{ steps.version.outputs.version }}"
for i in 1 2 3; do
git pull --rebase origin gh-pages && git push origin gh-pages && break
echo "Push attempt $i failed, retrying in $((i * 5))s..."
sleep $((i * 5))
done
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*/
public class PluginManager {

public final static String DEFAULT_PLUGIN_BASE_URL_STR = "https://archive.aavso.org/sites/default/files/vstar-plugins/vstar-plugins-"
public final static String DEFAULT_PLUGIN_BASE_URL_STR = "https://aavso.github.io/VStar/plugins/"
+ ResourceAccessor.getVersionString();

// public final static String DEFAULT_PLUGIN_BASE_URL_STR =
Expand Down Expand Up @@ -152,7 +152,7 @@
* @return the remote plugins map
*/
public Map<String, URL> getRemotePluginsByJarName() {
return remotePlugins;

Check warning on line 155 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getRemotePluginsByJarName() may expose internal representation by returning PluginManager.remotePlugins
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

Check warning on line 155 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getRemotePluginsByJarName() may expose internal representation by returning PluginManager.remotePlugins
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
}

/**
Expand Down Expand Up @@ -261,7 +261,7 @@
* @return the remote plugin map
*/
public Map<String, String> getRemoteDescriptionsToJarName() {
return remoteDescriptions;

Check warning on line 264 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getRemoteDescriptionsToJarName() may expose internal representation by returning PluginManager.remoteDescriptions
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

Check warning on line 264 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getRemoteDescriptionsToJarName() may expose internal representation by returning PluginManager.remoteDescriptions
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
}

/**
Expand All @@ -275,14 +275,14 @@
* @return the local plugins map
*/
public Map<String, File> getLocalPluginsByJarName() {
return localPlugins;

Check warning on line 278 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getLocalPluginsByJarName() may expose internal representation by returning PluginManager.localPlugins
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

Check warning on line 278 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getLocalPluginsByJarName() may expose internal representation by returning PluginManager.localPlugins
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
}

/**
* @return the local descriptions map
*/
public Map<String, String> getLocalDescriptionsToJarName() {
return localDescriptions;

Check warning on line 285 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getLocalDescriptionsToJarName() may expose internal representation by returning PluginManager.localDescriptions
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

Check warning on line 285 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getLocalDescriptionsToJarName() may expose internal representation by returning PluginManager.localDescriptions
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
}

/**
Expand All @@ -296,7 +296,7 @@
* @return the libs
*/
public Map<String, List<URL>> getLibs() {
return libs;

Check warning on line 299 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getLibs() may expose internal representation by returning PluginManager.libs
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

Check warning on line 299 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

EI_EXPOSE_REP

org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.getLibs() may expose internal representation by returning PluginManager.libs
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
}

/**
Expand Down Expand Up @@ -429,7 +429,7 @@
URLConnection conn = infoUrl.openConnection();

List<String> lineList = new ArrayList<String>();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {

Check warning on line 432 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

DM_DEFAULT_ENCODING

Found reliance on default encoding in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.retrieveRemotePluginInfo(String): new java.io.InputStreamReader(InputStream)
Raw output
Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.

Check warning on line 432 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

DM_DEFAULT_ENCODING

Found reliance on default encoding in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.retrieveRemotePluginInfo(String): new java.io.InputStreamReader(InputStream)
Raw output
Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
String line;
while ((line = reader.readLine()) != null) {
lineList.add(line);
Expand Down Expand Up @@ -631,7 +631,7 @@

List<URL> depLibs = new ArrayList<URL>();
if (pluginLibPath.exists() && pluginLibPath.isDirectory()) {
for (File file : pluginLibPath.listFiles(jarFilter)) {

Check warning on line 634 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.retrieveLocalPluginInfo() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

Check warning on line 634 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.retrieveLocalPluginInfo() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.
try {
depLibs.add(file.toURI().toURL());
} catch (Exception e) {
Expand All @@ -646,7 +646,7 @@

if (pluginPath.exists() && pluginPath.isDirectory()) {

for (File file : pluginPath.listFiles(jarFilter)) {

Check warning on line 649 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.retrieveLocalPluginInfo() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

Check warning on line 649 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.retrieveLocalPluginInfo() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

if (interrupted)
break;
Expand Down Expand Up @@ -710,7 +710,7 @@
+ File.separator + PLUGINS_DIR);

if (!pluginDirPath.exists()) {
pluginDirPath.mkdir();

Check warning on line 713 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE

Exceptional return value of java.io.File.mkdir() ignored in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.installPlugin(String, PluginManager$Operation)
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.

Check warning on line 713 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE

Exceptional return value of java.io.File.mkdir() ignored in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.installPlugin(String, PluginManager$Operation)
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.
}

String jarName = remoteDescriptions.get(description);
Expand Down Expand Up @@ -908,7 +908,7 @@
if (pluginDirPath.isDirectory()
&& pluginLibDirPath.isDirectory()) {
File[] jarFiles = pluginDirPath.listFiles();
for (File jarFile : jarFiles) {

Check warning on line 911 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.deleteAllPlugins() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

Check warning on line 911 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.deleteAllPlugins() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.
//if (interrupted) {
// deleteError = true;
// break;
Expand All @@ -923,7 +923,7 @@
}

File[] libJarFiles = pluginLibDirPath.listFiles();
for (File libJarFile : libJarFiles) {

Check warning on line 926 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.deleteAllPlugins() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

Check warning on line 926 in src/org/aavso/tools/vstar/ui/dialog/plugin/manager/PluginManager.java

View workflow job for this annotation

GitHub Actions / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in org.aavso.tools.vstar.ui.dialog.plugin.manager.PluginManager.deleteAllPlugins() due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.
if (interrupted) {
deleteError = true;
break;
Expand Down
Loading