Repository navigation
Fix plugin API documentation - #740
Merged
Merged
Conversation
Only keep what is actually needed for plugins. Remove classes that were never documented for plugins.
Expose the information about the used interpreter of a step.
Document the SCM class and the subset of its methods that plugins may use.
Give plugins access to the SCMs of a checkout step. Other steps return an empty list.
Describe the arguments and return types of all methods that are part of the plugin API. Fix some outdated or wrong descriptions along the way: * The PluginSetting class docstring was not picked up because it was placed after the priority attribute. * Step.jobServer() does not return a bool but the jobserver mode. * Step.getWorkspacePath() referenced the non-existing getExecPath().
String functions require at least apiVersion 0.15. Both the example in the manual and the override sample plugin declared 0.2 and would be rejected when loaded.
State trackers and string functions are passed an Env object and not a plain dict. The path-fmt sample plugin even relies on Env.substitute(). Document the subset that plugins may use and explain why the environment cannot be iterated.
The example used PackageSet.queryTreePath() which is not part of the plugin API. Use queryPackagePath() instead. The default query now matches all root packages, as promised by the help text.
The manifest referenced releaseFormatter and developFormatter which are not defined in the example.
The 'state' manifest key was not documented at all. Describe how state trackers are registered and instantiated, where their name is used and add an example.
The buildSteps, checkoutSteps and packageSteps kwargs are dictionary views. They can be iterated but not indexed.
Plugins must not generate packages themselves. Commands are passed the already generated package set instead.
Many methods return internal lists and dictionaries instead of copies. Modifying them would corrupt the state of Bob.
The properties passed to PluginState.onEnter() and onFinish() belong to the recipe and are shared by all of its packages. Modifying them leaks into other packages and is not covered by the package cache. Only the environment may be modified. Changes in onEnter() are inherited by the dependencies while changes in onFinish() only affect the current package.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #740 +/- ##
==========================================
- Coverage 90.41% 90.40% -0.01%
==========================================
Files 59 59
Lines 17404 17404
==========================================
- Hits 15735 15734 -1
- Misses 1669 1670 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.