Skip to content

Commit 953e485

Browse files
committed
[JENKINS-65398] Terminology changes
1 parent 525575e commit 953e485

File tree

12 files changed

+36
-36
lines changed

12 files changed

+36
-36
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Versions 2.7 and later are listed in [GitHub releases](https://github.com/jenkin
7474
- [JENKINS-40836](https://issues.jenkins-ci.org/browse/JENKINS-40836)
7575
Report the primary branch (`default`) to multibranch UIs.
7676
- [JENKINS-23571](https://issues.jenkins-ci.org/browse/JENKINS-23571)
77-
Configurable master cache directory location.
77+
Configurable controller cache directory location.
7878

7979
## Version 1.57 (Oct 12, 2016)
8080

src/main/java/hudson/plugins/mercurial/Cache.java

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* <p>
3030
* This substantially improves the performance by reducing the amount of data that needs to be transferred.
31-
* One cache will be built on the Hudson master, then per-slave cache is cloned from there.
31+
* One cache will be built on the Hudson controller, then per-agent cache is cloned from there.
3232
*
3333
* @see HUDSON-4794: manages repository caches.
3434
* @author Jesse Glick
@@ -73,8 +73,8 @@ private Cache(String remote, String hash, StandardUsernameCredentials credential
7373
}
7474

7575
/**
76-
* Gets a lock for the given slave node.
77-
* @param node Name of the slave node.
76+
* Gets a lock for the given agent node.
77+
* @param node Name of the agent node.
7878
* @return The {@link ReentrantLock} instance.
7979
*/
8080
private synchronized ReentrantLock getLockForSlaveNode(String node) {
@@ -95,19 +95,19 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
9595
* The node that gets a local cached repository.
9696
*
9797
* @return
98-
* The file path on the {@code node} to the local repository cache, cloned off from the master cache.
98+
* The file path on the {@code node} to the local repository cache, cloned off from the controller cache.
9999
*/
100100
@CheckForNull FilePath repositoryCache(MercurialInstallation inst, Node node, Launcher launcher, TaskListener listener, boolean useTimeout)
101101
throws IOException, InterruptedException {
102102
boolean masterWasLocked = masterLock.isLocked();
103103
if (masterWasLocked) {
104-
listener.getLogger().println("Waiting for master lock on hgcache/" + hash + " " + masterLock + "...");
104+
listener.getLogger().println("Waiting for controller lock on hgcache/" + hash + " " + masterLock + "...");
105105
}
106106

107-
// Always update master cache first.
107+
// Always update controller cache first.
108108
final Node master = Jenkins.getInstance();
109109
if (master == null) { // Should not happen
110-
throw new IOException("Cannot retrieve the Jenkins master node");
110+
throw new IOException("Cannot retrieve the Jenkins controller node");
111111
}
112112

113113
FilePath masterCaches = null;
@@ -116,23 +116,23 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
116116
} else {
117117
FilePath rootPath = master.getRootPath();
118118
if (rootPath == null) {
119-
throw new IOException("Cannot retrieve the root directory of the Jenkins master node");
119+
throw new IOException("Cannot retrieve the root directory of the Jenkins controller node");
120120
}
121121
masterCaches = rootPath.child("hgcache");
122122
}
123123

124124
FilePath masterCache = masterCaches.child(hash);
125125
Launcher masterLauncher = node == master ? launcher : master.createLauncher(listener);
126126

127-
// hg invocation on master
127+
// hg invocation on controller
128128
// do we need to pass in EnvVars from a build too?
129129
try (HgExe masterHg = new HgExe(inst, credentials, masterLauncher, master, listener, new EnvVars())) {
130-
// Lock the block used to verify we end up having a cloned repo in the master,
130+
// Lock the block used to verify we end up having a cloned repo in the controller,
131131
// whether if it was previously cloned in a different build or if it's
132132
// going to be cloned right now.
133133
masterLock.lockInterruptibly();
134134
try {
135-
listener.getLogger().println("Acquired master cache lock.");
135+
listener.getLogger().println("Acquired controller cache lock.");
136136
// TODO use getCredentials()
137137
if (masterCache.isDirectory()) {
138138
ArgumentListBuilder args = masterHg.seed(true).add("pull");
@@ -150,27 +150,27 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
150150
}
151151
} finally {
152152
masterLock.unlock();
153-
listener.getLogger().println("Master cache lock released.");
153+
listener.getLogger().println("Controller cache lock released.");
154154
}
155155
if (node == master) {
156156
return masterCache;
157157
}
158-
// Not on master, so need to create/update local cache as well.
158+
// Not on controller, so need to create/update local cache as well.
159159

160-
// We are in a slave node that will need also an updated local cache: clone it or
160+
// We are in a agent node that will need also an updated local cache: clone it or
161161
// pull pending changes, if any. This can be safely done in parallel in
162-
// different slave nodes for a given repo, so we'll use different
162+
// different agent nodes for a given repo, so we'll use different
163163
// node-specific locks to achieve this.
164164
ReentrantLock slaveNodeLock = getLockForSlaveNode(node.getNodeName());
165165

166166
boolean slaveNodeWasLocked = slaveNodeLock.isLocked();
167167
if (slaveNodeWasLocked) {
168-
listener.getLogger().println("Waiting for slave node cache lock in " + node.getNodeName() + " on hgcache/" + hash + " " + slaveNodeWasLocked + "...");
168+
listener.getLogger().println("Waiting for agent node cache lock in " + node.getNodeName() + " on hgcache/" + hash + " " + slaveNodeWasLocked + "...");
169169
}
170170

171171
slaveNodeLock.lockInterruptibly();
172172
try {
173-
listener.getLogger().println("Acquired slave node cache lock for node " + node.getNodeName() + ".");
173+
listener.getLogger().println("Acquired agent node cache lock for node " + node.getNodeName() + ".");
174174

175175
final FilePath nodeRootPath = node.getRootPath();
176176
if (nodeRootPath == null) {
@@ -186,7 +186,7 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
186186
FilePath masterTransfer = masterCache.child(bundleFileName);
187187
FilePath localTransfer = localCache.child("xfer.hg");
188188
try {
189-
// hg invocation on the slave
189+
// hg invocation on the agent
190190
try (HgExe slaveHg = new HgExe(inst, credentials, launcher, node, listener, new EnvVars())) {
191191
if (localCache.isDirectory()) {
192192
// Need to transfer just newly available changesets.
@@ -195,8 +195,8 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
195195
if (localHeads.equals(masterHeads)) {
196196
listener.getLogger().println("Local cache is up to date.");
197197
} else {
198-
// If there are some local heads not in master, they must be ancestors of new heads.
199-
// If there are some master heads not in local, they could be descendants of old heads,
198+
// If there are some local heads not in controller, they must be ancestors of new heads.
199+
// If there are some controller heads not in local, they could be descendants of old heads,
200200
// or they could be new branches.
201201
// Issue1910: in Hg 1.4.3 and earlier, passing --base $h for h in localHeads will fail
202202
// to actually exclude those head sets, but not a big deal. (Hg 1.5 fixes that but leaves
@@ -235,7 +235,7 @@ private synchronized ReentrantLock getLockForSlaveNode(String node) {
235235
return localCache;
236236
} finally {
237237
slaveNodeLock.unlock();
238-
listener.getLogger().println("Slave node cache lock released for node " + node.getNodeName() + ".");
238+
listener.getLogger().println("agent node cache lock released for node " + node.getNodeName() + ".");
239239
}
240240
}
241241
}

src/main/java/hudson/plugins/mercurial/HgExe.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public HgExe(@CheckForNull MercurialInstallation inst, @CheckForNull StandardUse
144144
}
145145
sshPrivateKey = slaveRoot.createTempFile("jenkins-mercurial", ".sshkey");
146146
sshPrivateKey.chmod(0600);
147-
// just in case slave goes offline during command; createTempFile fails to do it:
147+
// just in case agent goes offline during command; createTempFile fails to do it:
148148
sshPrivateKey.act(new DeleteOnExit());
149149
try (OutputStream os = sshPrivateKey.write()) {
150150
os.write(keyData);

src/main/java/hudson/plugins/mercurial/MercurialSCM.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public SCMRevisionState calcRevisionsFromBuild(Run<?, ?> build, FilePath workspa
370370
// tag action is added during checkout, so this shouldn't be called, but just in case.
371371
EnvVars env = build.getEnvironment(listener);
372372

373-
//TODO: fall-back to the master's workspace?
373+
//TODO: fall-back to the controller's workspace?
374374
if (workspace == null) {
375375
throw new IOException("Workspace is not specified");
376376
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div>
2-
Location of cached repositories on the master node.
2+
Location of cached repositories on the controller node.
33
Default : $JENKINS_HOME/hgcache
44
</div>

src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-useCaches.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
When checked, Hudson will maintain a cache of the Mercurial repository in use
33
by a project. The
44
cache will be kept on the master node, updated on demand, and additional
5-
caches may be kept on slave nodes running this job. All jobs pointing to the
5+
caches may be kept on agent nodes running this job. All jobs pointing to the
66
same repository location will share a single cache (even if they use different
77
named branches). If you have several jobs using the same repository location,
88
or one job using multiple workspaces, enabling caching can substantially

src/test/java/hudson/plugins/mercurial/FunctionalTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class FunctionalTest {
5656
@ClassRule public static DockerClassRule<MercurialContainer> docker = new DockerClassRule<>(MercurialContainer.class);
5757
@ClassRule public static BuildWatcher buildWatcher = new BuildWatcher();
5858

59-
/** Whether to run builds on a slave, or only on master. */
59+
/** Whether to run builds on a agent, or only on controller. */
6060
@Parameterized.Parameter(0) public boolean useSlave;
6161
public interface MercurialInstallationFactory {
6262
@CheckForNull MercurialInstallation create(@Nonnull JenkinsRule j, @Nonnull MercurialContainer container, @CheckForNull Slave slave, @Nullable MercurialContainer.Version version) throws Exception;
@@ -126,7 +126,7 @@ public interface MercurialInstallationFactory {
126126
{true, defaultFactory, MercurialContainer.Version.HG5},
127127
{false, cachingFactory, null},
128128
// Skip testing caching with older Hg versions since a locally installed version might be 3.x+,
129-
// in which case master sends a new version and we get abort: xfer.hg: unknown bundle version 20
129+
// in which case controller sends a new version and we get abort: xfer.hg: unknown bundle version 20
130130
// cf. https://hglabhq.com/blog/2014/4/29/what-s-new-in-mercurial-3-0
131131
{true, cachingFactory, MercurialContainer.Version.HG3},
132132
{true, cachingFactory, MercurialContainer.Version.HG4},
@@ -151,7 +151,7 @@ public interface MercurialInstallationFactory {
151151
slave = useSlave ? container.createSlave(j) : null;
152152
inst = mercurialInstallationFactory.create(j, container, slave, mercurialVersion);
153153
if (inst != null && inst.isUseCaches() || slave == null) {
154-
// Set up test repository on master, if we have hg installed locally.
154+
// Set up test repository on controller, if we have hg installed locally.
155155
repo = new FilePath(tmp.getRoot());
156156
} else {
157157
// Set up test repository on agent.

src/test/java/hudson/plugins/mercurial/MatrixProjectTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class MatrixProjectTest {
5757
}
5858

5959
private void assertAllMatrixRunsBuildSameMercurialRevision() throws Exception {
60-
//set the second slave offline, to give us the opportunity to push changes to the original Mercurial repository
60+
//set the second agent offline, to give us the opportunity to push changes to the original Mercurial repository
6161
//between the scheduling of the build and the actual run.
6262
Node slaveTwo = j.jenkins.getNode("slave_two");
6363
slaveTwo.toComputer().setTemporarilyOffline(true, null);
@@ -78,7 +78,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
7878
//push an extra commit to the central repository
7979
m.touchAndCommit(repo, "b");
8080

81-
//let the second slave start the build that was scheduled before this commit
81+
//let the second agent start the build that was scheduled before this commit
8282
slaveTwo.toComputer().setTemporarilyOffline(false, null);
8383

8484
MatrixBuild r = matrixBuildFuture.get();

src/test/java/hudson/plugins/mercurial/MercurialContainer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public Slave createSlave(JenkinsRule r) throws Exception {
5656
int num = r.jenkins.getNodes().size();
5757
String credentialsId = "test" + num;
5858
SystemCredentialsProvider.getInstance().setDomainCredentialsMap(Collections.singletonMap(Domain.global(), Collections.<Credentials>singletonList(new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsId, null, "test", "test"))));
59-
DumbSlave slave = new DumbSlave("slave" + num,"/home/test/slave", new SSHLauncher(ipBound(22), port(22), credentialsId));
59+
DumbSlave slave = new DumbSlave("agent" + num,"/home/test/agent", new SSHLauncher(ipBound(22), port(22), credentialsId));
6060
slave.setNumExecutors(1);
6161
slave.setLabelString("mercurial");
6262
r.jenkins.addNode(slave);

src/test/java/hudson/plugins/mercurial/MercurialSCMSource2Test.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public class MercurialSCMSource2Test {
7373
FilePath sampleRepo = slave.getRootPath().child("sampleRepo");
7474
sampleRepo.mkdirs();
7575
m.hg(sampleRepo, "init");
76-
// Tricky because the SSH URL will not work on that agent; it is actually only valid on the master.
77-
// So we need to check out on the master, which is where branch indexing happens as well.
76+
// Tricky because the SSH URL will not work on that agent; it is actually only valid on the controller.
77+
// So we need to check out on the controller, which is where branch indexing happens as well.
7878
sampleRepo.child("Jenkinsfile").write("node('master') {checkout scm}", null);
7979
m.hg(sampleRepo, "commit", "--addremove", "--message=flow");
8080
MercurialSCMSource s = new MercurialSCMSource("ssh://test@" + container.ipBound(22) + ":" + container.port(22) + "/" + sampleRepo);

src/test/java/hudson/plugins/mercurial/PipelineTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public class PipelineTest {
149149

150150
@Issue("JENKINS-42278")
151151
@Test public void exactRevisionMercurial() throws Exception {
152-
// TODO mostly pointless to use MercurialContainer here since multibranch requires a caching installation and thus for hg to be installed on master
152+
// TODO mostly pointless to use MercurialContainer here since multibranch requires a caching installation and thus for hg to be installed on controller
153153
FilePath sampleRepo = new FilePath(tmp.getRoot());
154154
m.hg(sampleRepo, "init");
155155
ScriptApproval sa = ScriptApproval.get();

src/test/java/hudson/plugins/mercurial/SCMTestBase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ protected void assertClone(String log, boolean cloneExpected) {
466466
/**
467467
* The change log should be based on comparison with the previous build, not
468468
* depending on the state of the current local clone. If a workspace is
469-
* wiped out, or the build is run on a new slave, it should still result in
469+
* wiped out, or the build is run on a new agent, it should still result in
470470
* the same change log. This test verifies that, by comparing the "normal"
471471
* behavior with when the workspace is removed after every build.
472472
*/

0 commit comments

Comments
 (0)