-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(travis): Refactor and simplify Travis polling (#467)
* chore(travis): Refactor and simplify Travis polling Previously, the polling, using the Travis v2 API, asked Travis for ~50 repos with recently built builds, and then, _for each repo_, asked for the 5 most recent builds. In other words, each polling cycle hits Travis with ~51 potentially heavy API calls (plus more to fetch logs). This commit brings that number down to 1, using the v3 API, and also removes a lot of code that belongs to the v2 API or was just band-aid for the quirks in the v2 API. One of those quirks was that some builds sometimes disappeared from the API as soon as they were built. I have not been able to verify 100% that this bug is gone in the v3 API, and because this commit removes the band-aid, we should proceed with caution before deploying to production. * Increase default number of jobs retrieved to 300 * Add a couple of @deprecated annotations and fix a comment * Add back the tracking cache due to limitations in the Travis API Should give us the best of both worlds; no more missed builds and still quite a bit easier on the Travis API. I still need to update tests, will fix ASAP. * Fix tests * Add back getJobConfig to TravisService that I erroneously removed in 890bb44 * Add back repo sync and the duration logging * Add toMillis() to duration logging
- Loading branch information
1 parent
bf88163
commit 3108caf
Showing
36 changed files
with
692 additions
and
1,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
...web/src/main/groovy/com/netflix/spinnaker/igor/build/model/GenericJobConfiguration.groovy
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
igor-web/src/main/groovy/com/netflix/spinnaker/igor/build/model/GenericJobConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.netflix.spinnaker.igor.build.model; | ||
|
||
import java.util.List; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class GenericJobConfiguration implements JobConfiguration { | ||
private String description; | ||
private String displayName; | ||
private String name; | ||
private boolean buildable; | ||
private String url; | ||
private boolean concurrentBuild; | ||
private List<GenericParameterDefinition> parameterDefinitionList; | ||
|
||
public GenericJobConfiguration( | ||
String description, | ||
String displayName, | ||
String name, | ||
boolean buildable, | ||
String url, | ||
boolean concurrentBuild, | ||
List<GenericParameterDefinition> genericParameterDefinition) { | ||
this.description = description; | ||
this.displayName = displayName; | ||
this.name = name; | ||
this.buildable = buildable; | ||
this.url = url; | ||
this.concurrentBuild = concurrentBuild; | ||
this.parameterDefinitionList = genericParameterDefinition; | ||
} | ||
|
||
public GenericJobConfiguration(String description, String name) { | ||
this.description = description; | ||
this.name = name; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...eb/src/main/groovy/com/netflix/spinnaker/igor/build/model/GenericParameterDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.netflix.spinnaker.igor.build.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class GenericParameterDefinition implements ParameterDefinition { | ||
private String name; | ||
private String defaultValue; | ||
private String description = ""; | ||
|
||
public GenericParameterDefinition(String name, String defaultValue) { | ||
this.name = name; | ||
this.defaultValue = defaultValue; | ||
} | ||
|
||
public GenericParameterDefinition(String name, String defaultValue, String description) { | ||
this(name, defaultValue); | ||
this.description = description; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
igor-web/src/main/groovy/com/netflix/spinnaker/igor/build/model/ParameterDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2019 Schibsted ASA. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.igor.build.model; | ||
|
||
public interface ParameterDefinition { | ||
String getName(); | ||
|
||
String getDefaultValue(); | ||
|
||
String getDescription(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.