-
Notifications
You must be signed in to change notification settings - Fork 1
GH-1:Adding repository handling to code #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
const groupId = node.groupId ? node.groupId[0] : ''; | ||
const artifactId = node.artifactId ? node.artifactId[0] : ''; | ||
const version = node.version ? node.version[0] : ''; | ||
const groupId = node.groupId ? node.groupId[0] : (node.parent ? getCoordinatesFromNode(node.parent[0]).groupId : undefined ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, based on https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance , it looks like this works for the version as well, so let's check and make sure that we inherit version as well.
There's an interesting caveat to this that because it only works in situations where there is a parent at the same level meaning that parent elements and dependency elements are safe. We might want to add a comment here to indicate that for parent or dependencies, the parent check won't matter because it's not possible.
src/main/pom-parser/pom-parser.js
Outdated
updatePolicy, | ||
checksumPolicy | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove unnecessary blank line
<id>Target</id> | ||
</repository> | ||
</repositories> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove unnecessary blank lines here
src/main/pom-parser/pom-parser.js
Outdated
}; | ||
}; | ||
|
||
const getStatusFromRepo = (release) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These elements are actually considered a "RepositoryPolicy" based on the type specified in the xsd.
Let's go ahead and update our naming to be consistent with that.
<xs:element minOccurs="0" name="releases" type="RepositoryPolicy">
<xs:annotation>
<xs:documentation source="version">4.0.0+</xs:documentation>
<xs:documentation source="description">
How to handle downloading of releases from this repository.
</xs:documentation>
</xs:annotation>
</xs:element>
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove unnecessary blank line
.then((pomContent) => { | ||
assert(pomContent.repositories.length === 0); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove unnecessary line.
<snapshots> | ||
<enabled>let</enabled> | ||
<updatePolicy>you</updatePolicy> | ||
<checksumPolicy>down</checksumPolicy> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well played 💯
assert.equal(emptyRSrepository.snapshots.enabled, undefined); | ||
assert.equal(emptyRSrepository.snapshots.updatePolicy, undefined); | ||
assert.equal(emptyRSrepository.snapshots.checksumPolicy, undefined); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove
|
||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove
repository = pomContent.repositories[2]; | ||
assert.equal(repository.id, 'Target'); | ||
assert.equal(repository.url, undefined); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove
No description provided.