API changes tracking#2673
Conversation
| - *prepare-mapbox-file | ||
| - *prepare-netrc-file | ||
| - *update-carthage-version | ||
| - *restore-cache | ||
| - *install-dependencies | ||
| - *install-dependencies-12 | ||
| - run: | ||
| name: Install prerequisites | ||
| command: if [ $(xcversion simulators | grep -cF "iOS << parameters.iOS >> Simulator (installed)") -eq 0 ]; then xcversion simulators --install="iOS << parameters.iOS >>" || true; fi | ||
| - *save-cache | ||
| - save-api-diff-cache-by-tag: | ||
| api_diff_cache: << parameters.base_api_tag >> |
There was a problem hiding this comment.
These steps should be run only if cache above was not restored. I could not find a working solution, so any suggestions are highly welcome.
| - run: | ||
| name: Generating MapboxCoreNavigation API Diff | ||
| command: cd scripts/APIDiffReport && swift run APIDiffReport diff $CIRCLE_WORKING_DIRECTORY/original_api/core_navigation_log.json $CIRCLE_WORKING_DIRECTORY/api_logs/core_navigation_log.json | ||
| - run: | ||
| name: Generating MapboxNavigation API Diff | ||
| command: cd scripts/APIDiffReport && swift run APIDiffReport diff $CIRCLE_WORKING_DIRECTORY/original_api/navigation_log.json $CIRCLE_WORKING_DIRECTORY/api_logs/navigation_log.json |
There was a problem hiding this comment.
These basically log changes to output and fail the CI. Should we Report the diff some other way?
There was a problem hiding this comment.
This is fine for now. When we work on a major version, we can make the build bot optional.
| let ignoredKeys = Set(arrayLiteral: "key.doc.line", "key.parsed_scope.end", "key.parsed_scope.start", "key.doc.column", "key.doc.comment", "key.bodyoffset", "key.nameoffset", "key.doc.full_as_xml", "key.offset", "key.fully_annotated_decl", "key.length", "key.bodylength", "key.namelength", "key.annotated_decl", "key.doc.parameters", "key.elements", "key.related_decls", | ||
| "key.filepath", "key.attributes", | ||
| "key.parsed_declaration", | ||
| "key.docoffset", "key.attributes") |
There was a problem hiding this comment.
Here we can configure which type of changes exactly we are interested right now.
| if accessibility as! String != "source.lang.swift.accessibility.public" && | ||
| accessibility as! String != "source.lang.swift.accessibility.open" { |
There was a problem hiding this comment.
There we control accessibility level of interest. Also, we can filter out undocumented or explicit ':nodoc:' items.
|
A sample diff output with v.0.40 could be found here. @kshehadeh, it would be also nice to receive any feedback or a use-cases from the Directions team so we could adjust the tool. |
This is very promising. I don't yet have access to CircleCI, but I'll check it out as soon as I do. |
|
Here's one as attachment: |
|
I'm having some trouble reading the output. Could you help explain what we're looking at there? |
|
The output lists detected updated made to public symbols, which are considered as breaking change. It should detect code-related points mentioned in this comment. Log contains the symbol name and it's location |
…c and compare results.
…ly generate logs and diffs.
…on as well as correcting typos and parameters values.
…ting intermediate output directories
0717b1b to
636a931
Compare
|
I've added some options to control the diff generation process from the command line. Now you can choose symbol access level you are interested in or if only documented symbols are included (useful for cases when only documented entities are considered publicly supported). For example, for added section of code like this: Only
I would also like to provide ability for user to select exact items to check (like only detect new functions, or only check |
This would be an interesting capability to have, but it could be tail work as long as the default is reasonable. To avoid a false sense of security, I think we’d want the default to check anything that could be a backwards-compatible change, at the risk of overcommunicating. We can make the check non-required at first.
Yeah, I don’t have a concrete use case in mind for filtering. Perhaps with the churn that’ll come with v2.0, we may want to sort changes by type or severity, but I don’t see us sometimes caring about method names and sometimes not caring. |
|
In case it helps, here’s a list I wrote up last year with help from @JThramer, before we dropped Objective-C support in #2230, of changes that would be considered backwards-incompatible:
|
|
@Udumft I think the CLI that @kshehadeh was interested in is the one that landed with mapbox/mapbox-directions-swift#469 (to validate Directions API responses) as opposed to this one (which is used to validate the SDK API contract). |
dcfd57f to
66b49a8
Compare
|
Closing in favour of #3103 |
Adding a script to resolve tracking Public API changes using CI script.
Currently at MVP stage and there are some known upgrades incoming:
APIDiffReportseparately and checking out it during the buildBase APIlog to avoid building it every timeBaseversion for comparison