From 30d29c32327b2fe3c49db4641648c4380399bd76 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Thu, 19 Dec 2024 09:29:58 -0500 Subject: [PATCH] refac(back): #1378 deprecate hello world - Deprecate builtin - Deprecate tests - Adapt CI - Adapt documentation Signed-off-by: Daniel Salazar --- .github/workflows/dev.yml | 16 ---------- .github/workflows/prod.yml | 20 ------------- docs/mkdocs.yaml | 1 - docs/src/api/builtins/deploy.md | 6 ++-- docs/src/api/builtins/examples.md | 30 ------------------- docs/src/getting-started.md | 12 ++++---- src/evaluator/modules/default.nix | 1 - src/evaluator/modules/hello-world/default.nix | 23 -------------- tests/helloWorld/makes.nix | 6 ---- tests/makes.nix | 1 - tests/pipelines/.gitlab-ci.yaml | 4 +-- tests/pipelines/makes.nix | 11 +------ 12 files changed, 12 insertions(+), 119 deletions(-) delete mode 100644 docs/src/api/builtins/examples.md delete mode 100644 src/evaluator/modules/hello-world/default.nix delete mode 100644 tests/helloWorld/makes.nix diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 338b1357..41816d0f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -119,22 +119,6 @@ jobs: - name: /formatYaml run: nix-env -if . && m . /formatYaml - linux_helloWorld: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 - - uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845 - name: /helloWorld - with: - args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /helloWorld" - macos_helloWorld: - runs-on: macos-latest - steps: - - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 - - uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac - - name: /helloWorld - run: nix-env -if . && m . /helloWorld - linux_lintBash: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 949246e1..859cac98 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -213,26 +213,6 @@ jobs: env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - linux_helloWorld: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 - - uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845 - name: /helloWorld - with: - args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /helloWorld" - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - macos_helloWorld: - runs-on: macos-latest - steps: - - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 - - uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac - - name: /helloWorld - run: nix-env -if . && m . /helloWorld - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - linux_lintBash: runs-on: ubuntu-latest steps: diff --git a/docs/mkdocs.yaml b/docs/mkdocs.yaml index 4a59023c..94fcf1f5 100644 --- a/docs/mkdocs.yaml +++ b/docs/mkdocs.yaml @@ -115,7 +115,6 @@ nav: - api/builtins/deploy.md - api/builtins/development.md - api/builtins/environment.md - - api/builtins/examples.md - api/builtins/format.md - api/builtins/framework-configuration.md - api/builtins/lint.md diff --git a/docs/src/api/builtins/deploy.md b/docs/src/api/builtins/deploy.md index 6a696fba..bdd43ad2 100644 --- a/docs/src/api/builtins/deploy.md +++ b/docs/src/api/builtins/deploy.md @@ -101,10 +101,10 @@ Example: ... }: { computeOnAwsBatch = { - helloWorld = { + myJob = { attempts = 1; attemptDurationSeconds = 43200; - command = [ "m" "github:fluidattacks/makes@main" "/helloWorld" ]; + command = [ "m" "github:fluidattacks/makes@main" "/myJob" ]; definition = "makes"; environment = [ "ENV_VAR_FOR_WHATEVER" ]; memory = 1800; @@ -125,7 +125,7 @@ Example: === "Invocation" ```bash - m . /computeOnAwsBatch/helloWorld 1 2 3 + m . /computeOnAwsBatch/myJob 1 2 3 ``` Note that positional arguments (`[ "1" "2" "3" ]` in this case) diff --git a/docs/src/api/builtins/examples.md b/docs/src/api/builtins/examples.md deleted file mode 100644 index b979aa1b..00000000 --- a/docs/src/api/builtins/examples.md +++ /dev/null @@ -1,30 +0,0 @@ -## helloWorld - -Small command for demo purposes, it greets the specified user: - -Types: - -- helloWorld: - - enable (`boolean`): Optional. - Defaults to `false`. - - name (`string`): - Name of the user we should greet. - -Example: - -=== "makes.nix" - - ```nix - { - helloWorld = { - enable = true; - name = "Jane Doe"; - }; - } - ``` - -=== "Invocation" - - ```bash - m . /helloWorld 1 2 3 - ``` diff --git a/docs/src/getting-started.md b/docs/src/getting-started.md index 3470df3d..f24d4781 100644 --- a/docs/src/getting-started.md +++ b/docs/src/getting-started.md @@ -81,14 +81,14 @@ Example: name: Makes CI on: [push, pull_request] jobs: - helloWorld: + lintNix: runs-on: ubuntu-latest steps: - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 - uses: docker://ghcr.io/fluidattacks/makes:24.12 - name: helloWorld + name: lintNix with: - args: sh -c "chown -R root:root /github/workspace && m . /helloWorld 1 2 3" + args: sh -c "chown -R root:root /github/workspace && m . /lintNix" ``` ???+ note @@ -103,10 +103,10 @@ Example: ```yaml # .gitlab-ci.yml - /helloWorld: + /lintNix: image: ghcr.io/fluidattacks/makes:24.12 script: - - m . /helloWorld 1 2 3 + - m . /lintNix ``` === "Travis CI" @@ -119,7 +119,7 @@ Example: install: nix-env -if https://github.com/fluidattacks/makes/archive/24.12.tar.gz jobs: include: - - script: m . /helloWorld 1 2 3 + - script: m . /lintNix ``` ### Importing via Nix diff --git a/src/evaluator/modules/default.nix b/src/evaluator/modules/default.nix index 4fd14d5d..1ccf1998 100644 --- a/src/evaluator/modules/default.nix +++ b/src/evaluator/modules/default.nix @@ -15,7 +15,6 @@ (import ./format-nix/default.nix args) (import ./format-terraform/default.nix args) (import ./format-yaml/default.nix args) - (import ./hello-world/default.nix args) (import ./inputs/default.nix) (import ./jobs/default.nix args) (import ./lint-bash/default.nix args) diff --git a/src/evaluator/modules/hello-world/default.nix b/src/evaluator/modules/hello-world/default.nix deleted file mode 100644 index d37e9fb1..00000000 --- a/src/evaluator/modules/hello-world/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ makeScript, ... }: -{ config, lib, ... }: { - options = { - helloWorld = { - enable = lib.mkOption { - default = false; - type = lib.types.bool; - }; - name = lib.mkOption { type = lib.types.str; }; - }; - }; - config = { - outputs = { - "/helloWorld" = lib.mkIf config.helloWorld.enable (makeScript { - name = "hello-world"; - entrypoint = '' - info Hello from Makes! ${config.helloWorld.name}. - info You called us with CLI arguments: [ "$@" ]. - ''; - }); - }; - }; -} diff --git a/tests/helloWorld/makes.nix b/tests/helloWorld/makes.nix deleted file mode 100644 index 55b56697..00000000 --- a/tests/helloWorld/makes.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - helloWorld = { - enable = true; - name = "Jane Doe"; - }; -} diff --git a/tests/makes.nix b/tests/makes.nix index 98efa6e0..1cd2207c 100644 --- a/tests/makes.nix +++ b/tests/makes.nix @@ -2,7 +2,6 @@ imports = [ ./commitlint/makes.nix ./computeOnAwsBatch/makes.nix - ./helloWorld/makes.nix ./lintWithAjv/makes.nix ./makeScript/makes.nix ./makeSearchPaths/makes.nix diff --git a/tests/pipelines/.gitlab-ci.yaml b/tests/pipelines/.gitlab-ci.yaml index ac3a6234..11673de0 100644 --- a/tests/pipelines/.gitlab-ci.yaml +++ b/tests/pipelines/.gitlab-ci.yaml @@ -1,9 +1,9 @@ -/helloWorld__1__2__3: +/formatNix: image: ghcr.io/fluidattacks/makes:24.12 interruptible: true needs: [] script: - - m . /helloWorld '1' '2' '3' + - m . /formatNix variables: GIT_DEPTH: 3 MAKES_GIT_DEPTH: 3 diff --git a/tests/pipelines/makes.nix b/tests/pipelines/makes.nix index fc40a042..3f58849f 100644 --- a/tests/pipelines/makes.nix +++ b/tests/pipelines/makes.nix @@ -2,16 +2,7 @@ pipelines = { example = { gitlabPath = "/tests/pipelines/.gitlab-ci.yaml"; - jobs = [ - { - output = "/lintNix"; - args = [ ]; - } - { - output = "/helloWorld"; - args = [ "1" "2" "3" ]; - } - ]; + jobs = [ { output = "/lintNix"; } { output = "/formatNix"; } ]; }; }; }