Skip to content

Commit

Permalink
rename createCosaRemoteSession -> makeCosaRemoteSession
Browse files Browse the repository at this point in the history
Apparently Codacy/Codenarc has some arbitrary rules about naming
functions starting with make/create/build and it doesn't like this
function being named create*. Rather than fight it I'll just change
the name and move on to something more important.

```
Error: FactoryMethodName

A factory method is a method that creates objects, and they are
typically named either buildFoo(), makeFoo(), or createFoo().
This rule enforces that only one naming convention is used.
It defaults to allowing makeFoo(), but that can be changed using
the property regex.
```
  • Loading branch information
dustymabe committed Jan 23, 2024
1 parent c041f3d commit e8a1de7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jobs/build-arch.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ lock(resource: "build-${params.STREAM}-${basearch}") {
// We set the session to time out after 5h. This essentially
// performs garbage collection on the remote if we fail to clean up.
pipeutils.withPodmanRemoteArchBuilder(arch: basearch) {
def session = pipeutils.createCosaRemoteSession(
def session = pipeutils.makeCosaRemoteSession(
env: container_env,
expiration: "${timeout_mins}m",
image: cosa_img,
Expand Down
2 changes: 1 addition & 1 deletion jobs/bump-lockfile.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ lock(resource: "bump-lockfile") {
parallel archinfo.keySet().collectEntries{arch -> [arch, {
if (arch != "x86_64") {
pipeutils.withPodmanRemoteArchBuilder(arch: arch) {
archinfo[arch]['session'] = pipeutils.createCosaRemoteSession(
archinfo[arch]['session'] = pipeutils.makeCosaRemoteSession(
env: container_env,
expiration: "${timeout_mins}m",
image: cosa_img,
Expand Down
2 changes: 1 addition & 1 deletion jobs/debug-pod.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ cosaPod(cpu: "${ncpus}",
// We set the session to time out after 4h. This essentially
// performs garbage collection on the remote if we fail to clean up.
pipeutils.withPodmanRemoteArchBuilder(arch: params.ARCH) {
def session = pipeutils.createCosaRemoteSession(
def session = pipeutils.makeCosaRemoteSession(
env: container_env,
expiration: "${params.TIMEOUT}h",
image: cosa_img,
Expand Down
4 changes: 2 additions & 2 deletions utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def bump_builds_json(stream, buildid, arch, s3_stream_dir, acl) {
}
}

// Create a COSA remote session, which is usually used to
// Make a COSA remote session, which is usually used to
// build on a different architecture.
//
// Available parameters:
Expand All @@ -236,7 +236,7 @@ def bump_builds_json(stream, buildid, arch, s3_stream_dir, acl) {
// long the container should last (i.e. 4h, 30m)
// image: string that represents the container image to pull
// workdir: string that represents the in container working directory
def createCosaRemoteSession(params = [:]) {
def makeCosaRemoteSession(params = [:]) {
def expiration = params['expiration']
def image = params['image']
def workdir = params['workdir']
Expand Down

0 comments on commit e8a1de7

Please sign in to comment.