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

Generating plugins lock file #631

Closed
wants to merge 22 commits into from
Closed

Generating plugins lock file #631

wants to merge 22 commits into from

Conversation

aSky17
Copy link
Contributor

@aSky17 aSky17 commented Dec 23, 2023

fixes #488
plugins-lock.txt file is the full list of plugins generated at a point in time with a specific Jenkins version and includes the plugins declared by the user and all the dependencies of those plugins.

plugins-lock.txt file describe all the plugins and versions that were read from the Jenkins update center at the time the command was executed.

A plugins-lock.txt file is created on the same directory as the plugins.txt, in which plugins were listed to be downloaded and the listed plugins as well their dependencies are written in the lock file.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes

}
logVerbose("Plugin lock file (" + pluginLockFile + ") has been successfully created.");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
Copy link

@abhishekmaity abhishekmaity Jan 28, 2024

Choose a reason for hiding this comment

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

Avoid e.printStackTrace() by Logging Exception Output Instead

use logger.info("Unsupported encoding: ", e); through import org.apache.log4j.Logger; . Details can be read at CodeQL documentaion https://codeql.github.com/codeql-query-help/java/java-stack-trace-exposure/

} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
Copy link

@abhishekmaity abhishekmaity Jan 28, 2024

Choose a reason for hiding this comment

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

Same use logger.info("IOException occurred: ", e); through import org.apache.log4j.Logger; instead of e.printStackTrace();

Copy link

@abhishekmaity abhishekmaity left a comment

Choose a reason for hiding this comment

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

I added some suggestion for code improvement above

@aSky17 aSky17 closed this Mar 4, 2024
@aSky17 aSky17 deleted the generating-plugins-lock-file branch March 4, 2024 16:06
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.

Generate plugins lock file from list of plugins
5 participants