Skip to content

Commit

Permalink
Update grpc work around dependency to match fabric (hyperledger-archi…
Browse files Browse the repository at this point in the history
…ves#2400)

Also relaxes the exact version checks for this dependency only

Closes #2361

Signed-off-by: James Taylor <[email protected]>
  • Loading branch information
jt-nti authored and bestbeforetoday committed Oct 19, 2017
1 parent 2c18aeb commit cd7c815
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
6 changes: 3 additions & 3 deletions packages/composer-connector-hlfv1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"dependencies": {
"composer-common": "0.14.2",
"composer-runtime-hlfv1": "0.14.2",
"fabric-ca-client": "1.0.1",
"fabric-client": "1.0.1",
"fabric-ca-client": "1.0.2",
"fabric-client": "1.0.2",
"fs-extra": "1.0.0",
"grpc": "1.6.0",
"grpc": ">=1.3.5 <2.0.0",
"semver": "5.3.0",
"temp": "0.8.3",
"thenify-all": "1.6.0",
Expand Down
37 changes: 21 additions & 16 deletions scripts/depcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,30 @@ packageNames.forEach((packageName) => {

// Not going to catch ranges but unlikely to see those anyway
const badDependencies = {};
for (const i in packages) {
const currentPackage = packages[i];
for (const dependency in currentPackage.dependencies) {
const currentValue = currentPackage.dependencies[dependency];
if (isNaN(currentValue.slice(0,1))) {
if (!badDependencies[i]) {
badDependencies[i] = [];
}
badDependencies[i].push({ dependency: dependency, currentValue: currentValue });
const checkValue = function checkValue(packageIndex, dependency, currentValue) {
if (packages[packageIndex].name === 'composer-connector-hlfv1' && dependency === 'grpc') {
// Due to https://jira.hyperledger.org/browse/FAB-6425 we currently
// need to relax the exact value restriction on grpc in composer-connector-hlfv1
// The dependency and this hack should be removed as soon as we can make
// use of the fixed version of fabric-ca-client!
return;
}

if (isNaN(currentValue.slice(0,1))) {
if (!badDependencies[packageIndex]) {
badDependencies[packageIndex] = [];
}
badDependencies[packageIndex].push({ dependency: dependency, currentValue: currentValue });
}
};

for (const packageIndex in packages) {
const currentPackage = packages[packageIndex];
for (const dependency in currentPackage.dependencies) {
checkValue(packageIndex, dependency, currentPackage.dependencies[dependency]);
}
for (const dependency in currentPackage.devDependencies) {
const currentValue = currentPackage.devDependencies[dependency];
if (isNaN(currentValue.slice(0,1))) {
if (!badDependencies[i]) {
badDependencies[i] = [];
}
badDependencies[i].push({ dependency: dependency, currentValue: currentValue });
}
checkValue(packageIndex, dependency, currentPackage.devDependencies[dependency]);
}
}

Expand Down

0 comments on commit cd7c815

Please sign in to comment.