-
Notifications
You must be signed in to change notification settings - Fork 0
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
Extensions #105
Comments
How should we approach this? An extension is a function that runs before or after an action, or maybe those two functions combined. As an example, let's consider unit test results. We would like to display the test results to the user after they have run. In the Java platform,
Several questions arise here.
Passing Information to ExtensionsA logical and often-used method of passing data is using artifacts. The job declares an artifact that holds the test results, and the extension could be configured to know about this artifact. When the extension runs, it could use the API to download the artifact and access the contents. Since downloading artifacts should already be provided in the API, this does not require special permissions or coding. But it may not be the most efficient solution, passing the raw data directly may be easier, but it does create it's own problems. For instance, what happens if the raw data is very large? Like a dump file used to analyze memory consumption? So, for sake of simplicity, let's just assume we'll use artifacts for this. Displaying the ResultsAfter the processed information is stored in the job, it should be available for displaying. But how should this be displayed? Ideally, the extension itself is responsible for this. Somehow the extension should the contain some frontend code for this? Or we need to provide a generic way to render information like this? Or should we allow the extension to generate html that is displayed directly in the GUI? Including frontend code seems overly complicated, it would require defining some sort of "frontend api" for this. Since the frontend is centralized (i.e. not specific to the build script), this would also create security issues. Generic rendering would only work if we, again, define some sort of contract that the extension should adhere to. The content could be provided as The third solution, rendering ConclusionI think we should only consider the last two solutions, since the first would be too complicated and risky. The second is the safest albeit the most inflexible. But let's try it out and see if it is usable. |
See also issue #136 |
Backend has been implemented. Using it in frontend not yet. I have added some ad-hoc code to display test results, which is provided by an extension. I think we should stick to this for now, and add some generic way later on. |
Extensions are a way to link functionality to a job property. An extension follows the interceptor pattern: it has a "before" and "after" phase, both are optional. They have full access to the runtime. When including an extension dependency in
deps.edn
, you should also require it so it gets "registered". MonkeyCI will apply the extension when it encounters a key on a job for which that extension was registered.We could set up caches and artifacts as extensions this way.
Possible additional features:
The text was updated successfully, but these errors were encountered: