-
Notifications
You must be signed in to change notification settings - Fork 170
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
add pipeline support #176
add pipeline support #176
Conversation
022b57e
to
dab320b
Compare
@@ -10,30 +10,31 @@ | |||
import java.util.ArrayList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you would remove the //CHECKSTYLE:OFF setting for the files that you modify and correct all the checkstyle warnings and errors in that file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho a passing checkstyle run as part of the build is a minimal requirement for a contribution. Just get your IDE to format it correctly in an automated fashion. Or fix it manually if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I removed the //CHECKSTYLE:OFF comments and fixed the fallout
new RemoveWorkspaceAction(workspaceConfiguration.getWorkspaceName()).remove(server); | ||
nodeConfiguration.setWorkspaceWasRemoved(); | ||
nodeConfiguration.save(); | ||
Computer computer = workspaceFilePath.toComputer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add final where appropriate (checkstyle will find these)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
while (lastRun != null) { | ||
AbstractBuild<?,?> build = lastRun; | ||
AbstractBuild<?,?> build = (AbstractBuild)lastRun; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check the "instanceOf" lastRun before casting here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the comment I understood that node was only going to be NULL in Hudson core < 1.321, which doesn't support pipelines (so no Run class, just AbstractBuild). But I get that's a bit thin....I went ahead and added a check, just in case
@@ -19,16 +21,26 @@ | |||
|
|||
private final List<ChangeSet> changesets; | |||
|
|||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A TODO here with information on when we should remove these deprecated methods would help. For instance, should we remove them with the next major version release or can they be removed with the next minor release. A comment on who might be using these methods would also help clarify when they can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the methods is still being used by a few tests (added a comment). Removed the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, but I had a few suggested changes.
dab320b
to
c2ae166
Compare
TeamFoundationServerScm.buildEnvironment required for envvars from checkout step |
c2ae166
to
eab95c6
Compare
@kvarec good catch, fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes!
According to https://issues.jenkins-ci.org/browse/JENKINS-36703 in method TeamFoundationServerScm.calcRevisionsFromBuild required to return SCMRevisionState.NONE instead of null |
baba450
to
f585335
Compare
@kvarec yep, polling was busted since it was calling a deprecated method that required AbstractProject. I fixed it and ensure polling works as expected. |
And from https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Ftfs-plugin/detail/PR-176/8/pipeline/17:
|
f585335
to
63fa9b1
Compare
I went ahead and fixed the issues in \TeamFoundationServerScm.java, but I still get: \tfs\src\main\java\hudson\plugins\tfs\JenkinsEventNotifier.java:0: error: File does not end with a newline. however, my change did not touch those files. Furthermore, looking at those files, they do end in a newline, so I am not sure what the linter is complaining about. Could this be a problem on the backend? not sure who can take a look at this.... @kvarec |
The build should be up and running again now. Please rebase/merge and try again. |
@adelcast Can you add a doc or to README.md to give sample pipeline code that works with TFS and available parameters that can be used? |
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Follow the guide on https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md. Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
63fa9b1
to
347da08
Compare
@cdenneen is that really needed? The Snippet Generator already documents that for you. I looked at the Subversion/Git/Mercurial plugins and they don't explicitly document the pipeline usage (they rely on the Snippter Generator) |
@jpricketMSFT done, now we have all green, =) |
Any timeline on when we'll have this merged and a new version of the plugin released? |
@fuzzmz - we hope to get this merged and released by the end of next week. Sorry for the delay. |
oops, didn't mean to close this. |
So, after use pipeline to checkout tfs. How should we get the changeset since the functions returns a null .Does someone help please |
You need to upgrade your version of Jenkins pipeline plugins. I think its 2.5 that fixes the problem where checkout returns null. After you upgrade your pipeline plugins, checkout should return a map with all the TFS environment variables you need. |
@adelcast, plz can you provide the documentation to trigger a release in vsts via pipeline ? |
@Tetradeus Did you manged to find any documentation on how to use this plugin via a Scripted/Declarative pipeline? |
nop, sorry. |
It seems to get enabled via set build trigger to SCM poll. I used this pipeline script which do this automatically if build is triggered manually.
|
Add Pipeline support to TFS plugin