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
Check if plugin uses Piwik methods that are Deprecated or not API #6539
Comments
👍 this will be so useful! Maybe you already mean this by "Automated test" but could we add an automated test that is executed in each plugin's build and that fails the plugin's build whenever the plugin uses a function that does is not tagged with |
that's meant |
Good news: work in progress in the phpstorm plugin: https://github.com/piwik/phpstorm-plugin-piwikstorm Next steps is to run this in CI somehow. @diosmosis please write update here when you have one 👍 |
Status: Need to get phpstorm running on travis. To do that, we need to register phpstorm on travis using our license file. Which is not straightforward. Can either use the license file or server (according to jetbrains), but not sure how. |
did you try to ask Jetbrains support to explain us the exact steps to
get this going? I've emailed them few times before and they were
helpful, but maybe that's more complex...
|
Emailed jetbrains, waiting for a reply. |
There is a possibility that what we want to do is not even possible... hopefully jetbrains support will be helpful and give us the solution, otherwise the work done so far may be "useless" (at least at automating the detection of deprecated code, we could still do it manually from time to time...) |
Status: managed to get phpstorm license recognized in travis. Currently the process is killed before finishing. |
Note that this code inspection ideally should run for:
Maybe it will be necessary to add a new CI job to each build to run this code inspect? |
I think that would require a new CI job. Though it would be good if it didn't run on EVERY commit, just maybe master/develop branches. Or maybe for these repos we can setup our own server and add a github check (like travis/scrutinizer does) so travis doesn't get clogged. |
@mattab It looks like running the inspections can exhaust the memory, can we only run one build (not job, at least not yet) at a time on piwik-tests-plugins? |
Aren't all Travis builds (even jobs) run into a separate virtual machine? |
You're right, I read the docs wrong. Not sure what to do though, I don't think it's possible to increase the memory. |
Status: inspections are created and uploaded as artifacts, ie, http://builds-artifacts.piwik.org/protected/LoginLdap.code_quality_tests/408.1/inspections/ TODO:
|
Here it says the max memory builds can use is 3Gb if it helps http://docs.travis-ci.com/user/common-build-problems/#My-build-script-is-killed-without-any-error |
That's what I read ;) |
What are the most little amount of work left to have it already useful in production? (for example for MVP I think we don't need the UI/JS part simply we could read Travis log output to see which file+line calls which deprecated / non-api function) |
Weekly report of maintained plugins' use of non- Follow up issue here: #7569 |
@diosmosis that's interesting :) where will those reports be? E.g. do you have a link to an example? |
If you look in the protected builds artifacts server you'll see folders like inspections.all or inspections.pluginname. Check those out (inspections.all is the most readable) |
On http://builds-artifacts.piwik.org/? I can't find those folders in there (or in subfolders) :( |
Builds-artifacts.org/protected/. Doesn't get listed in directory ;) |
Nice progress! 👍 |
Plugins should only use methods that are declared in any
plugins/*/API.php
or any method or property tagged with@api
.We should check all PHP files within a plugin for any illicit method, constant or property usage and output any that is not public. If anything is used that is
@deprecated
a warning should be shown. If a plugin uses any method from another plugin (API.php) we should check whether the dependency is defined inrequire
section ofplugin.json
.This can be useful
https://github.com/nikic/PHP-Parser/ could be used for this which we already use in documentation generator.
The text was updated successfully, but these errors were encountered: