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

Display plugin version on home page #369

Merged
merged 11 commits into from
Dec 20, 2024

Conversation

SohamJuneja
Copy link
Contributor

@SohamJuneja SohamJuneja commented Dec 18, 2024

Fixes #362

image

Added plugin version at the footer of home page.

Testing done

Local testing

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
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@krisstern
Copy link
Member

Looks like all CI/CD checks are passing on GitHub

@janfaracik
Copy link
Contributor

Few small changes requested - thanks!

@SohamJuneja
Copy link
Contributor Author

  • thanks to the help of @krisstern , I am now able to preview the changes I've made without any errors. I can see the version at the footer now , but the thing is it shows :
    [999999-SNAPSHOT (private-9bfa0ac3-Lenovo)
    What could be the reason for this?

@janfaracik
Copy link
Contributor

  • thanks to the help of @krisstern , I am now able to preview the changes I've made without any errors. I can see the version at the footer now , but the thing is it shows :

[999999-SNAPSHOT (private-9bfa0ac3-Lenovo)

What could be the reason for this?

That's the SNAPSHOT version when running locally, once it's deployed it'll show the actual release version. Nothing to worry about :)


public String getPluginVersion() {
Jenkins jenkins = Jenkins.get();
if (jenkins != null) {
Copy link
Member

@uhafner uhafner Dec 18, 2024

Choose a reason for hiding this comment

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

You need to remove this if block as Jenkins cannot be null. (My first assumption was wrong. Jenkins null handling actually is very ugly)

@SohamJuneja
Copy link
Contributor Author

Added the desired changes , now it's failing because of that spotless issue. I had applied mvn spotless:apply locally then pushed however this showed error when pushed. This has happened to me before too , I don't know why.

@SohamJuneja
Copy link
Contributor Author

SohamJuneja commented Dec 19, 2024

Thanks for your guidance @uhafner @janfaracik . I've applied the required changes. If further changes are needed , I can work on them too.

@janfaracik janfaracik marked this pull request as ready for review December 19, 2024 22:41
@janfaracik janfaracik requested a review from a team as a code owner December 19, 2024 22:41
Copy link
Contributor

@janfaracik janfaracik left a comment

Choose a reason for hiding this comment

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

Made a couple small tweaks, looks good to me! Thanks for contributing. I'll merge if you're happy @uhafner

Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

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

Now the null handling is fine! Thanks for the PR!

@timja timja merged commit 0761fac into jenkinsci:master Dec 20, 2024
17 checks passed
@SohamJuneja SohamJuneja deleted the display-version branch December 20, 2024 17:27
@SohamJuneja
Copy link
Contributor Author

Welcome and thanks again for your guidance !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show version on landing page
5 participants