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

[JENKINS-68030] Optionally report most recent commit as changelog of a new build #1565

Merged
merged 37 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3e62161
Add files via upload
rhit-inskeeda Mar 20, 2024
838cc41
code for gui
rhit-inskeeda Mar 20, 2024
d76a507
trait file
rhit-inskeeda Mar 20, 2024
5f681b3
gitscm changes
rhit-inskeeda Mar 20, 2024
756f77c
testing for new trait behavior
rhit-inskeeda Mar 20, 2024
b5ba0e8
Merge pull request #1 from rhit-inskeeda/new-trait
rhit-inskeeda Mar 20, 2024
d6f6cf9
null check time
rhit-gawronja Mar 20, 2024
27d5942
update to proper version number
rhit-inskeeda Mar 22, 2024
ce2fd99
Update FirstBuildChangelogTrait
rhit-inskeeda Mar 22, 2024
d17fafd
Merge branch 'master' into integration
MarkEWaite Apr 2, 2024
370d763
Format new files with spotless:apply
MarkEWaite Apr 2, 2024
c66d139
Remove trailing space characters
MarkEWaite Apr 2, 2024
88640c5
Changed equals to use proper equals method
rhit-gawronja Apr 2, 2024
62aad20
Changed equals to use proper equals method
rhit-gawronja Apr 2, 2024
cab31cc
Changed equals to use proper equals method
rhit-gawronja Apr 2, 2024
baa7384
Merge remote-tracking branch 'origin/integration' into integration
rhit-gawronja Apr 2, 2024
84846d7
changed to compatible equal
rhit-gawronja Apr 2, 2024
6f4fa4d
Fix Mark's poor code review
MarkEWaite Apr 2, 2024
1664429
Use leading lower case letter for the symbol
MarkEWaite Apr 2, 2024
47ab82b
Use sentence case for display name
MarkEWaite Apr 2, 2024
a9eacdf
Set API release to 5.3.0
MarkEWaite Apr 2, 2024
24c444b
Merge branch 'master' into integration
MarkEWaite Apr 8, 2024
143b0d2
removed groovy and checkbox
rhit-inskeeda Apr 16, 2024
ae92de6
Merge pull request #2 from rhit-inskeeda/no-groovy
rhit-inskeeda Apr 16, 2024
5dfe120
Update to documentation and applying spotless
rhit-gawronja Apr 17, 2024
a803d34
Pushing documentation image
rhit-gawronja Apr 17, 2024
45e7fff
Undo spotless changes - not ready for spotless
MarkEWaite May 1, 2024
4499e95
Reduce doc diffs
MarkEWaite May 1, 2024
591d0da
Merge branch 'master' into integration
MarkEWaite May 1, 2024
8df79db
Use Unix file format for help
MarkEWaite May 1, 2024
667a4fa
Jenkins Pipeline symbols start with a lower case letter
MarkEWaite May 1, 2024
11955ee
Remove blank line from doc example
MarkEWaite May 1, 2024
34be383
First build changelog reports most recent commit as changelog
MarkEWaite May 1, 2024
13816f4
Format new example same as prior examples.
MarkEWaite May 4, 2024
81606a6
Clarify first build option help and docs
MarkEWaite May 4, 2024
b449318
Merge branch 'master' into integration
MarkEWaite Jul 29, 2024
61bb758
Remove comment as suggested by reviewer
MarkEWaite Jul 29, 2024
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
Prev Previous commit
Next Next commit
Format new files with spotless:apply
Use line termination that is consistent with the other files in the repository.

Use import ordering as defined by spotless.
  • Loading branch information
MarkEWaite committed Apr 2, 2024
commit 370d763b642f356830541006ccc876b14ddc396e
Original file line number Diff line number Diff line change
@@ -1,78 +1,74 @@
package hudson.plugins.git.extensions.impl;

import hudson.Extension;
import hudson.plugins.git.extensions.GitSCMExtension;
import hudson.plugins.git.extensions.GitSCMExtensionDescriptor;
import java.util.Objects;

import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;

/**
* First Build generates a changelog.
*
* @author Derek Inskeep
*/
public class FirstBuildChangelog extends GitSCMExtension {
private boolean makeChangelog;

@DataBoundConstructor
public FirstBuildChangelog() {
}

public boolean isMakeChangelog() {
return makeChangelog;
}

@DataBoundSetter
public void setMakeChangelog(boolean makeChangelog) {
this.makeChangelog = makeChangelog;
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FirstBuildChangelog that = (FirstBuildChangelog) o;
return makeChangelog == that.makeChangelog;
}

/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return Objects.hash(makeChangelog);
}

/**
* {@inheritDoc}
*/
@Override
public String toString() {
return "FirstBuildChangelog{" +
"makeChangelog=" + makeChangelog +
'}';
}

@Extension
@Symbol("FirstBuildChangelog")
public static class DescriptorImpl extends GitSCMExtensionDescriptor {

/**
* {@inheritDoc}
*/
@Override
public String getDisplayName() {
return "First Build Changelog";
}
}
}
package hudson.plugins.git.extensions.impl;

import hudson.Extension;
import hudson.plugins.git.extensions.GitSCMExtension;
import hudson.plugins.git.extensions.GitSCMExtensionDescriptor;
import java.util.Objects;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;

/**
* First Build generates a changelog.
*
* @author Derek Inskeep
*/
public class FirstBuildChangelog extends GitSCMExtension {
private boolean makeChangelog;

@DataBoundConstructor
public FirstBuildChangelog() {}

public boolean isMakeChangelog() {
return makeChangelog;
}

@DataBoundSetter
public void setMakeChangelog(boolean makeChangelog) {
this.makeChangelog = makeChangelog;
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FirstBuildChangelog that = (FirstBuildChangelog) o;
return makeChangelog == that.makeChangelog;
MarkEWaite marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return Objects.hash(makeChangelog);
}

/**
* {@inheritDoc}
*/
@Override
public String toString() {
return "FirstBuildChangelog{" + "makeChangelog=" + makeChangelog + '}';
}

@Extension
@Symbol("FirstBuildChangelog")
public static class DescriptorImpl extends GitSCMExtensionDescriptor {

/**
* {@inheritDoc}
*/
@Override
public String getDisplayName() {
return "First Build Changelog";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
package jenkins.plugins.git.traits;

import hudson.Extension;
import hudson.plugins.git.extensions.impl.FirstBuildChangelog;
import jenkins.scm.api.trait.SCMSourceTrait;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

import edu.umd.cs.findbugs.annotations.CheckForNull;

/**
* Exposes {@link FirstBuildChangelog} as a {@link SCMSourceTrait}.
*
* @since 5.2.0
*/
public class FirstBuildChangelogTrait extends GitSCMExtensionTrait<FirstBuildChangelog> {

/**
* @deprecated Use constructor that accepts extension instead.
*/
@Deprecated
public FirstBuildChangelogTrait() {
this(null);
}

/**
* Stapler constructor.
*
* @param extension the option to force first build to have a non-empty changelog.
*/
@DataBoundConstructor
public FirstBuildChangelogTrait(@CheckForNull FirstBuildChangelog extension) {
super(extension == null ? new FirstBuildChangelog() : extension);
}

/**
* Our {@link hudson.model.Descriptor}
*/
@Extension
@Symbol("FirstBuildChangelog")
public static class DescriptorImpl extends GitSCMExtensionTraitDescriptor {
/**
* {@inheritDoc}
*/
@Override
public String getDisplayName() {
return "First Build Changelog";
}
}
}
package jenkins.plugins.git.traits;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import hudson.Extension;
import hudson.plugins.git.extensions.impl.FirstBuildChangelog;
import jenkins.scm.api.trait.SCMSourceTrait;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

/**
* Exposes {@link FirstBuildChangelog} as a {@link SCMSourceTrait}.
*
* @since 5.2.0
*/
public class FirstBuildChangelogTrait extends GitSCMExtensionTrait<FirstBuildChangelog> {

/**
* @deprecated Use constructor that accepts extension instead.
*/
@Deprecated
public FirstBuildChangelogTrait() {
this(null);
}

/**
* Stapler constructor.
*
* @param extension the option to force first build to have a non-empty changelog.
*/
@DataBoundConstructor
public FirstBuildChangelogTrait(@CheckForNull FirstBuildChangelog extension) {
super(extension == null ? new FirstBuildChangelog() : extension);
}

/**
* Our {@link hudson.model.Descriptor}
*/
@Extension
@Symbol("FirstBuildChangelog")
public static class DescriptorImpl extends GitSCMExtensionTraitDescriptor {
/**
* {@inheritDoc}
*/
@Override
public String getDisplayName() {
return "First Build Changelog";
}
}
}