Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Deprecating the job template feature #2798

Merged
merged 5 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Declarative Job Templates
# Declarative Job Templates -- Deprecated

Provide the ability to maintain job templates, akin to `onefuzz template
libfuzzer basic` at the service level. The templates include a job
Expand Down Expand Up @@ -94,7 +94,7 @@ TaskConfig(

## Hardcoded vs Runtime-specified Container Names

To support differentiating _always use "afl-linux" for tools_ vs _ask
To support differentiating _always use "afl-linux" for tools_ vs _ask
what container to use for setup_, if the container name is blank in the
template, it will be provided as part of the `JobTemplateConfig` and in the
resulting `JobTemplateRequest`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Managing Declarative Job Templates
# Managing Declarative Job Templates -- Deprecated

[Declarative Job Templates](declarative-templates.md), currently a preview
feature, allow a user to define a reusable fuzzing pipeline as a template.
Once saved, any user of the OneFuzz instance can create fuzzing jobs based on
the templates.

This is a walk-through guide for updating an existing job template, though
the process is similar for creating templates from scratch.
the process is similar for creating templates from scratch.

This process demonstrates adding [Microsoft Teams
notifications](notifications/teams.md) for new unique crash reports to an existing
Expand All @@ -27,9 +27,9 @@ notifications](notifications/teams.md) for new unique crash reports to an existi
onefuzz job_templates manage get libfuzzer_linux > libfuzzer_linux.json
```
3. With your preferred text editor, add the following to the `notifications` list:
```json
```json
{
"container_type": "unique_reports",
"container_type": "unique_reports",
"notification": {
"config": {
"url": "https://contoso.com/webhook-url-here"
Expand Down Expand Up @@ -120,7 +120,7 @@ Now let's make use of our new template.
"job_id": "d3259dfe-fdad-45a0-bf90-a381b8dc1ee8",
"state": "init"
}
$
$
```
3. Verify a notification was set up for the unique reports container
```
Expand Down Expand Up @@ -160,7 +160,7 @@ This example will demonstrate setting the following:
onefuzz job_templates manage get libfuzzer_linux > libfuzzer_linux_ado_areapath.json
```
3. With your preferred text editor, add the following to the `notifications` list:
```json
```json
{
"container_type": "unique_reports",
"notification": {
Expand Down Expand Up @@ -234,7 +234,7 @@ This example will demonstrate setting the following:
onefuzz job_templates refresh
```

Using `--help`, we can see the new optional and required arguments.
Using `--help`, we can see the new optional and required arguments.
```
$ onefuzz job_templates submit libfuzzer_linux_ado_areapath --help
usage: onefuzz job_templates submit libfuzzer_linux_ado_areapath [-h] [-v] [--format {json,raw}] [--query QUERY]
Expand Down
6 changes: 3 additions & 3 deletions src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1804,8 +1804,8 @@ def __init__(
self.tools = Tools(self)
self.instance_config = InstanceConfigCmd(self)

if self._backend.is_feature_enabled(PreviewFeature.job_templates.name):
self.job_templates = JobTemplates(self)
# if self._backend.is_feature_enabled(PreviewFeature.job_templates.name):
# self.job_templates = JobTemplates(self)

# these are externally developed cli modules
self.template = Template(self, self.logger)
Expand Down Expand Up @@ -1932,6 +1932,6 @@ def _warn_preview(self, feature: PreviewFeature) -> None:


from .debug import Debug # noqa: E402
from .job_templates.main import JobTemplates # noqa: E402
# from .job_templates.main import JobTemplates # noqa: E402
from .status.cmd import Status # noqa: E402
from .template import Template # noqa: E402