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

Commit

Permalink
Deprecating the job template feature (#2798)
Browse files Browse the repository at this point in the history
* deprecating the job template feature

* removing the code

* format
  • Loading branch information
chkeita authored Feb 8, 2023
1 parent d732028 commit f13f52a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
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
10 changes: 0 additions & 10 deletions src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1794,9 +1794,6 @@ def __init__(
self.instance_config = InstanceConfigCmd(self)
self.validate_scriban = ValidateScriban(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)
self.debug = Debug(self, self.logger)
Expand Down Expand Up @@ -1830,9 +1827,6 @@ def __setup__(
if tenant_domain is not None:
self._backend.config.tenant_domain = tenant_domain

if self._backend.is_feature_enabled(PreviewFeature.job_templates.name):
self.job_templates._load_cache()

def licenses(self) -> object:
"""Return third-party licenses used by this package"""
data = pkgutil.get_data("onefuzz", "data/licenses.json")
Expand Down Expand Up @@ -1860,9 +1854,6 @@ def login(self) -> str:
# actuates the login process
self.info.get()

# TODO: once job templates are out of preview, this should be enabled
if self._backend.is_feature_enabled(PreviewFeature.job_templates.name):
self.job_templates.refresh()
return "succeeded"

def config(
Expand Down Expand Up @@ -1922,6 +1913,5 @@ def _warn_preview(self, feature: PreviewFeature) -> None:


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

0 comments on commit f13f52a

Please sign in to comment.