Skip to content
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

chore(maven): Change pom.xml to add revapi #1115

Merged
merged 23 commits into from Jan 31, 2017
Merged

Conversation

surli
Copy link
Collaborator

@surli surli commented Jan 13, 2017

Use revapi to compare Spoon API against the last published snapshot. Fix #1023.
Thanks a lot @metlos for the support and quick changes on revapi.
Launched today and obtain the following result:

[INFO] Comparing [fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170112.234557-2] against [fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT] (including their transitive dependencies).
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.682 s
[INFO] Finished at: 2017-01-13T09:22:53+01:00
[INFO] Final Memory: 117M/857M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.revapi:revapi-maven-plugin:0.8.1:check (revapi-check) on project spoon-core: The following API problems caused the build to fail:
[ERROR] java.method.addedToInterface: method spoon.reflect.factory.QueryFactory spoon.reflect.factory.Factory::Query(): Method was added to an interface. (breaks semantic versioning)
[ERROR] java.method.addedToInterface: method spoon.reflect.visitor.chain.CtQuery spoon.reflect.factory.Factory::createQuery(): Method was added to an interface. (breaks semantic versioning)
[ERROR] java.method.addedToInterface: method spoon.reflect.visitor.chain.CtQuery spoon.reflect.factory.Factory::createQuery(java.lang.Object): Method was added to an interface. (breaks semantic versioning)
[ERROR] java.field.serialVersionUIDUnchanged: field spoon.reflect.factory.FactoryImpl.serialVersionUID: The class changed in an incompatible way with regards to serialization but the serialVersionUID field stayed unchanged. This might be ok and/or desired but is suspicious. (breaks semantic versioning)
[ERROR] java.method.added: method spoon.reflect.factory.QueryFactory spoon.reflect.factory.FactoryImpl::Query(): Method was added. (breaks semantic versioning)
[ERROR] java.method.added: method spoon.reflect.visitor.chain.CtQuery spoon.reflect.factory.FactoryImpl::createQuery(): Method was added. (breaks semantic versioning)
[ERROR] java.method.added: method spoon.reflect.visitor.chain.CtQuery spoon.reflect.factory.FactoryImpl::createQuery(java.lang.Object): Method was added. (breaks semantic versioning)
[ERROR] java.class.added: class spoon.reflect.factory.QueryFactory: Class was added. (breaks semantic versioning)
[ERROR] java.class.nonPublicPartOfAPI: class spoon.support.compiler.jdt.JDTTreeBuilderHelper: Class 'spoon.support.compiler.jdt.JDTTreeBuilderHelper' is indirectly included in the API (by the means of method return type for example) but the class is not accessible (neither public nor protected).
[ERROR] Use chain of the type in the old API: spoon.support.compiler.jdt.JDTTreeBuilderHelper is returned from method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() (method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() is part of the API)
[ERROR] Use chain of the type in the new API: spoon.support.compiler.jdt.JDTTreeBuilderHelper is returned from method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() (method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() is part of the API)

It currently breaks a mvn install and so, it should break a Travis build if a change in the API is not documented.
We can still ignore some changes in the API editing revapi.json file. Maybe it should be good to document our process concerning changes in the API and the usage of revapi (add justification to breaks inside the revapi.json).

@surli
Copy link
Collaborator Author

surli commented Jan 13, 2017

Note that it's also possible to automatically change the version number of the future release to respect the semantic versioning:

[ERROR] If you're using the semver-ignore extension, update your module's version to one compatible with the current changes (e.g. mvn package revapi:update-versions).

@monperrus
Copy link
Collaborator

Cool. I propose to extensively comment revapi.json, so that we easily understand what it means.

@surli surli changed the title chore(maven): Change pom.xml to add revapi WiP: chore(maven): Change pom.xml to add revapi Jan 18, 2017
@monperrus
Copy link
Collaborator

@surli,
added in pull_request-INRIA-spoon-master-revapi

if [[ -f chore/revapy.py ]];
then python chore/revapy.py $GH_USER $GH_TOKEN $1
fi

in order not to have PR failures while this one is not merged.

@surli
Copy link
Collaborator Author

surli commented Jan 25, 2017

Analysis results


Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170124.234602-14

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

old:

new: interface spoon.compiler.SpoonCompiler

java.class.added: Class was added. (breaks semantic versioning)

SOURCE: NON_BREAKING, OTHER: BREAKING, BINARY: NON_BREAKING

old: class spoon.support.compiler.jdt.JDTTreeBuilderHelper

new: class spoon.support.compiler.jdt.JDTTreeBuilderHelper

java.class.nonPublicPartOfAPI: Class 'spoon.support.compiler.jdt.JDTTreeBuilderHelper' is indirectly included in the API (by the means of method return type for example) but the class is not accessible (neither public nor protected).

Use chain of the type in the old API: spoon.support.compiler.jdt.JDTTreeBuilderHelper is returned from method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() (method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() is part of the API)

Use chain of the type in the new API: spoon.support.compiler.jdt.JDTTreeBuilderHelper is returned from method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() (method spoon.support.compiler.jdt.JDTTreeBuilderHelper spoon.support.compiler.jdt.JDTTreeBuilder::getHelper() is part of the API) (breaks semantic versioning)

SOURCE: NON_BREAKING, OTHER: BREAKING, SEMANTIC: BREAKING, BINARY: NON_BREAKING

old: field spoon.support.DefaultCoreFactory.serialVersionUID

new: field spoon.support.DefaultCoreFactory.serialVersionUID

java.field.serialVersionUIDUnchanged: The class changed in an incompatible way with regards to serialization but the serialVersionUID field stayed unchanged. This might be ok and/or desired but is suspicious. (breaks semantic versioning)

SOURCE: EQUIVALENT, OTHER: BREAKING, SEMANTIC: POTENTIALLY_BREAKING, BINARY: EQUIVALENT

old:

new: method boolean spoon.support.compiler.jdt.JDTBasedSpoonCompiler::compileInputSources()

java.method.added: Method was added. (breaks semantic versioning)

SOURCE: NON_BREAKING, OTHER: BREAKING, BINARY: NON_BREAKING

old:

new: method spoon.reflect.cu.SourcePosition spoon.reflect.factory.CoreFactory::createSourcePosition(spoon.reflect.cu.CompilationUnit, int, int, int, int[])

java.method.addedToInterface: Method was added to an interface. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, SEMANTIC: POTENTIALLY_BREAKING, BINARY: NON_BREAKING

old: method R spoon.reflect.visitor.chain.CtQuery::first()

new:

java.method.removed: Method was removed. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, BINARY: BREAKING

old: method R spoon.reflect.visitor.chain.CtQuery::first(java.lang.Class)

new:

java.method.removed: Method was removed. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, BINARY: BREAKING

old:

new: method java.lang.ClassLoader spoon.compiler.Environment::getClassLoader()

java.method.addedToInterface: Method was added to an interface. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, SEMANTIC: POTENTIALLY_BREAKING, BINARY: NON_BREAKING

old:

new: method java.util.List spoon.reflect.declaration.CtElement::getReferences(spoon.reflect.visitor.Filter)

java.method.addedToInterface: Method was added to an interface. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, SEMANTIC: POTENTIALLY_BREAKING, BINARY: NON_BREAKING

old:

new: method boolean spoon.reflect.declaration.CtTypeInformation::isAssignableFrom(spoon.reflect.reference.CtTypeReference<?>)

java.method.addedToInterface: Method was added to an interface. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, SEMANTIC: POTENTIALLY_BREAKING, BINARY: NON_BREAKING

old: method boolean spoon.reflect.visitor.EarlyTerminatingScanner::isTerminated()

new:

java.method.removed: Method was removed. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, BINARY: BREAKING

old: method spoon.reflect.visitor.chain.CtQuery spoon.reflect.visitor.chain.CtQuery::select(spoon.reflect.visitor.Filter)

new:

java.method.removed: Method was removed. (breaks semantic versioning)

SOURCE: BREAKING, OTHER: BREAKING, BINARY: BREAKING

@surli
Copy link
Collaborator Author

surli commented Jan 25, 2017

@monperrus for now the Gakoci hook only use the branch of the PR creator which is quite inconveniant as old API can be considered. Just have a look at the beginning of the last comment and you'll see...
In order to change that I proposed a PR in gakoci: monperrus/gakoci#1 to be able to generate the report considering the merged commit of the PR easily (just using the PR number actually).

@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170130.234600-20

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 15.

Change 1

Name Element
Old class spoon.reflect.visitor.filter.CatchVariableReferenceFunction
New none
Code java.class.removed
Description Class was removed.
Breaking binary: breaking, source: breaking

Change 2

Name Element
Old class spoon.reflect.visitor.filter.CatchVariableScopeFunction
New none
Code java.class.removed
Description Class was removed.
Breaking binary: breaking, source: breaking

Change 3

Name Element
Old class spoon.reflect.visitor.filter.LocalVariableReferenceFunction
New none
Code java.class.removed
Description Class was removed.
Breaking binary: breaking, source: breaking

Change 4

Name Element
Old class spoon.reflect.visitor.filter.LocalVariableScopeFunction
New none
Code java.class.removed
Description Class was removed.
Breaking binary: breaking, source: breaking

Change 5

Name Element
Old class spoon.reflect.visitor.filter.ParameterReferenceFunction
New none
Code java.class.removed
Description Class was removed.
Breaking binary: breaking, source: breaking

Change 6

Name Element
Old class spoon.reflect.visitor.filter.ParameterScopeFunction
New none
Code java.class.removed
Description Class was removed.
Breaking binary: breaking, source: breaking

Change 7

Name Element
Old class spoon.support.compiler.jdt.JDTTreeBuilderHelper
New class spoon.support.compiler.jdt.JDTTreeBuilderHelper
Code java.class.nonPublicPartOfAPI
Description Class 'spoon.support.compiler.jdt.JDTTreeBuilderHelper' is indirectly included in the API (by the means of method return type for example) but the class is not accessible (neither public nor protected).
Breaking binary: non_breaking, source: non_breaking, semantic: breaking

Change 8

Name Element
Old none
New method spoon.reflect.cu.SourcePosition spoon.reflect.factory.CoreFactory::createSourcePosition(spoon.reflect.cu.CompilationUnit, int, int, int, int[])
Code java.method.addedToInterface
Description Method was added to an interface.
Breaking binary: non_breaking, source: breaking, semantic: potentially_breaking

Change 9

Name Element
Old method R spoon.reflect.visitor.chain.CtQuery::first()
New none
Code java.method.removed
Description Method was removed.
Breaking binary: breaking, source: breaking

Change 10

Name Element
Old method R spoon.reflect.visitor.chain.CtQuery::first(java.lang.Class)
New none
Code java.method.removed
Description Method was removed.
Breaking binary: breaking, source: breaking

Change 11

Name Element
Old none
New method java.lang.ClassLoader spoon.compiler.Environment::getClassLoader()
Code java.method.addedToInterface
Description Method was added to an interface.
Breaking binary: non_breaking, source: breaking, semantic: potentially_breaking

Change 12

Name Element
Old none
New method java.util.List spoon.reflect.declaration.CtElement::getReferences(spoon.reflect.visitor.Filter)
Code java.method.addedToInterface
Description Method was added to an interface.
Breaking binary: non_breaking, source: breaking, semantic: potentially_breaking

Change 13

Name Element
Old none
New method boolean spoon.reflect.declaration.CtTypeInformation::isAssignableFrom(spoon.reflect.reference.CtTypeReference<?>)
Code java.method.addedToInterface
Description Method was added to an interface.
Breaking binary: non_breaking, source: breaking, semantic: potentially_breaking

Change 14

Name Element
Old method boolean spoon.reflect.visitor.EarlyTerminatingScanner::isTerminated()
New none
Code java.method.removed
Description Method was removed.
Breaking binary: breaking, source: breaking

Change 15

Name Element
Old method spoon.reflect.visitor.chain.CtQuery spoon.reflect.visitor.chain.CtQuery::select(spoon.reflect.visitor.Filter)
New none
Code java.method.removed
Description Method was removed.
Breaking binary: breaking, source: breaking

@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170130.234600-20

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 1.

Change 1

Name Element
Old class spoon.support.compiler.jdt.JDTTreeBuilderHelper
New class spoon.support.compiler.jdt.JDTTreeBuilderHelper
Code java.class.nonPublicPartOfAPI
Description Class 'spoon.support.compiler.jdt.JDTTreeBuilderHelper' is indirectly included in the API (by the means of method return type for example) but the class is not accessible (neither public nor protected).
Breaking source: non_breaking, binary: non_breaking, semantic: breaking

@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170130.234600-20

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 0.

@monperrus monperrus merged commit 8195e3c into INRIA:master Jan 31, 2017
@monperrus monperrus changed the title WiP: chore(maven): Change pom.xml to add revapi chore(maven): Change pom.xml to add revapi Jan 31, 2017
@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170130.234600-20

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 0.

1 similar comment
@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170130.234600-20

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants