-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from hmrc/APIS-4350
APIS-4350 Removed service-locator registration
- Loading branch information
Showing
12 changed files
with
80 additions
and
278 deletions.
There are no files selected for viewing
70 changes: 0 additions & 70 deletions
70
app/uk/gov/hmrc/apisubscriptionfields/config/ConfigurationProviders.scala
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
app/uk/gov/hmrc/apisubscriptionfields/config/ServiceLocatorRegistration.scala
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
app/uk/gov/hmrc/apisubscriptionfields/connector/ServiceLocatorConnector.scala
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
app/uk/gov/hmrc/apisubscriptionfields/model/Registration.scala
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import os, urllib, json | ||
import requests | ||
from sys import argv | ||
|
||
def fetchDependencies(repositoryName): | ||
r = urllib.urlopen(os.environ['CATALOGUE_DEPENDENCIES_URL']) | ||
j = json.load(r) | ||
for i in range(len(j)): | ||
if j[i]['repositoryName'] == repositoryName: | ||
return j[i] | ||
|
||
return {} | ||
|
||
def findOutOfDateDependencies(dependencies): | ||
outOfDateDependencies = [] | ||
for i in range(len(dependencies)): | ||
dependency = dependencies[i] | ||
latestVersion = (dependency['latestVersion']['major'], | ||
dependency['latestVersion']['minor'], | ||
dependency['latestVersion']['patch']) | ||
currentVersion = (dependency['currentVersion']['major'], | ||
dependency['currentVersion']['minor'], | ||
dependency['currentVersion']['patch']) | ||
|
||
if latestVersion > currentVersion: | ||
outOfDateDependencies.append(dependency) | ||
|
||
return outOfDateDependencies | ||
|
||
def reportOnDependencies(dependencyType, dependencies): | ||
print dependencyType + " needing upgrade:" | ||
outOfDateDependencies = findOutOfDateDependencies(dependencies) | ||
if len(outOfDateDependencies) > 0: | ||
for i in range(len(outOfDateDependencies)): | ||
dependency = outOfDateDependencies[i] | ||
print ' \033[38;5;15m\033[48;5;1m{} {}.{}.{} -> {}.{}.{}\033[39;49m'.format( | ||
dependency['name'], | ||
dependency['currentVersion']['major'], | ||
dependency['currentVersion']['minor'], | ||
dependency['currentVersion']['patch'], | ||
dependency['latestVersion']['major'], | ||
dependency['latestVersion']['minor'], | ||
dependency['latestVersion']['patch']) | ||
else: | ||
print '\033[38;5;2m No upgrades required\033[39;49m' | ||
|
||
|
||
def generateReport(repositoryName): | ||
print 'Generating dependency report...' | ||
dependencies = fetchDependencies(repositoryName) | ||
|
||
reportOnDependencies('Libraries', dependencies['libraryDependencies']) | ||
reportOnDependencies('SBT plugins', dependencies['sbtPluginsDependencies']) | ||
reportOnDependencies('Other dependencies', dependencies['otherDependencies']) | ||
|
||
|
||
if __name__ == "__main__": | ||
if 'CATALOGUE_DEPENDENCIES_URL' in os.environ: | ||
generateReport(argv[1]) | ||
else: | ||
print 'CATALOGUE_DEPENDENCIES_URL environment variable not set - cannot generate dependency report' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
sbt clean coverage test it:test acceptance:test coverageReport | ||
python dependencyReport.py api-subscription-fields |
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.