diff --git a/docs/declarative-templates.md b/docs/deprecated/declarative-templates.md similarity index 99% rename from docs/declarative-templates.md rename to docs/deprecated/declarative-templates.md index 80ee4fdba9..3f4aa4eca1 100644 --- a/docs/declarative-templates.md +++ b/docs/deprecated/declarative-templates.md @@ -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 @@ -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`. diff --git a/docs/managing-templates.md b/docs/deprecated/managing-templates.md similarity index 98% rename from docs/managing-templates.md rename to docs/deprecated/managing-templates.md index 7f8d46c8a5..3c129d0229 100644 --- a/docs/managing-templates.md +++ b/docs/deprecated/managing-templates.md @@ -1,4 +1,4 @@ -# 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. @@ -6,7 +6,7 @@ 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 @@ -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" @@ -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 ``` @@ -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": { @@ -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] diff --git a/src/cli/onefuzz/api.py b/src/cli/onefuzz/api.py index 6ce7d72fcd..14e7c8f47b 100644 --- a/src/cli/onefuzz/api.py +++ b/src/cli/onefuzz/api.py @@ -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) @@ -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") @@ -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( @@ -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