From ca2571d9ffccfbb156ce311c39a2f8e0621da42e Mon Sep 17 00:00:00 2001 From: Alexander Ilyin Date: Thu, 19 Dec 2024 06:03:03 +0000 Subject: [PATCH 1/3] Transfer repo to new organization. --- .devcontainer/devcontainer.json | 182 +++---------------------- .env | 2 +- .gitignore | 1 + .pre-commit-config.yaml | 4 +- .vscode/settings.json | 160 ++++++++++++++++++++++ README.md | 51 +++++-- src/apt/README.md | 2 +- src/pip/README.md | 2 +- src/pip/devcontainer-feature.json | 4 +- src/starship/README.md | 2 +- src/starship/devcontainer-feature.json | 2 +- 11 files changed, 228 insertions(+), 184 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a0baefa..3a90354 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,176 +12,30 @@ "Codeium.codeium" ], "settings": { - "remote.extensionKind": { - "GitHub.vscode-codeql": [ - "ui" - ] - }, - "tasks": { - "version": "2.0.0", - "tasks": [ - { - "label": "Dev Container Feature: Publish Packages", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "publish", - "--namespace", - "deepspacecartel/devcontainers-features", - "src/" - ], - "group": { - "kind": "build", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Generate Docs", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "generate-docs", - "--namespace", - "deepspacecartel/devcontainers-features", - "--project-folder", - "src/" - ], - "group": { - "kind": "build", - "isDefault": false - } - }, - { - "label": "pre-commit: manual", - "type": "shell", - "command": "pre-commit", - "args": [ - "run", - "--hook-stage", - "manual" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test Everything", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test" - ], - "group": { - "kind": "test", - "isDefault": true - } - }, - { - "label": "Dev Container Feature: Test Global Scenarios", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--global-scenarios-only", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test starship", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--features", - "starship", - "--remote-user", - "root", - "--base-image", - "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test apt", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--features", - "apt", - "--remote-user", - "root", - "--base-image", - "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - }, - { - "label": "Dev Container Feature: Test pip", - "type": "shell", - "command": "devcontainer", - "args": [ - "features", - "test", - "--features", - "pip", - "--remote-user", - "root", - "--base-image", - "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", - "/workspaces/devcontainers-features" - ], - "group": { - "kind": "test", - "isDefault": false - } - } - ] - }, - "dotfiles.repository": "deepspacecartel/dotfiles", - "editor.fontFamily": "'Hack Nerd Font Mono'", - "files.insertFinalNewline": true, - "json.schemas": [ - { - "fileMatch": [ - "*/devcontainer-feature.json" - ], - "url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json" - } - ], - "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'" + "dotfiles.repository": "partcad/dotfiles" } } }, + "containerEnv": { + "PRE_COMMIT_HOME": "${containerWorkspaceFolder}/.pre-commit" + }, + "postCreateCommand": { + "pre-commit": "pre-commit install" + }, "features": { - // "ghcr.io/deepspacecartel/devcontainers-features/starship:1": {}, - // "ghcr.io/deepspacecartel/devcontainers-features/pip:1": { - // "packages": "pre-commit", - // "location": "/opt/pip" - // }, - // "ghcr.io/deepspacecartel/devcontainers-features/apt:1": { + "ghcr.io/devcontainers/features/python:1": { + "installTools": true, + "toolsToInstall": [ + "pre-commit", + "poetry" + ], + "version": "latest" + }, + // "ghcr.io/partcad/devcontainers-features/starship:2": {}, + // "ghcr.io/partcad/devcontainers-features/apt:2": { // "packages": "shellcheck shfmt mc python3-pip python3-venv" // }, - // "ghcr.io/devcontainers/features/docker-in-docker:2": {} + "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", "remoteEnv": { diff --git a/.env b/.env index 1792869..270cfc2 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -GITHUB_TOKEN = "op://DeepSpaceCartel/GITHUB_TOKEN/CLASSIC" +GITHUB_TOKEN = "op://PartCAD/GITHUB_TOKEN/CLASSIC" diff --git a/.gitignore b/.gitignore index 64ac88f..ee154d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.pre-commit/ .venv/ output/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b38d07e..5205770 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -14,7 +14,7 @@ repos: hooks: - id: devcontainer-docs name: "Dev Container Features: Generate Docs" - entry: devcontainer features generate-docs --namespace deepspacecartel/devcontainers-features --project-folder src/ + entry: devcontainer features generate-docs --namespace partcad/devcontainers-features --project-folder src/ language: system always_run: true pass_filenames: false diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b9d2ef1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,160 @@ +{ "remote.extensionKind": { + "GitHub.vscode-codeql": [ + "ui" + ] + }, + "tasks": { + "version": "2.0.0", + "tasks": [ + { + "label": "Dev Container Feature: Publish Packages", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "publish", + "--namespace", + "partcad/devcontainers-features", + "src/" + ], + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Generate Docs", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "generate-docs", + "--namespace", + "partcad/devcontainers-features", + "--project-folder", + "src/" + ], + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "pre-commit: manual", + "type": "shell", + "command": "pre-commit", + "args": [ + "run", + "--hook-stage", + "manual" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test Everything", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test" + ], + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "Dev Container Feature: Test Global Scenarios", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--global-scenarios-only", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test starship", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--features", + "starship", + "--remote-user", + "root", + "--base-image", + "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test apt", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--features", + "apt", + "--remote-user", + "root", + "--base-image", + "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + }, + { + "label": "Dev Container Feature: Test pip", + "type": "shell", + "command": "devcontainer", + "args": [ + "features", + "test", + "--features", + "pip", + "--remote-user", + "root", + "--base-image", + "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "/workspaces/devcontainers-features" + ], + "group": { + "kind": "test", + "isDefault": false + } + } + ] + }, + "editor.fontFamily": "'Hack Nerd Font Mono'", + "files.insertFinalNewline": true, + "json.schemas": [ + { + "fileMatch": [ + "*/devcontainer-feature.json" + ], + "url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json" + } + ], + "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'", + "cSpell.words": [ + "ncontainers" + ] +} diff --git a/README.md b/README.md index 84615be..3f37cb8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dev Container Features -[![CI - Test Features](https://github.com/deepspacecartel/devcontainers-features/actions/workflows/test.yaml/badge.svg)](https://github.com/deepspacecartel/devcontainers-features/actions/workflows/test.yaml) +[![CI - Test Features](https://github.com/partcad/devcontainers-features/actions/workflows/test.yaml/badge.svg)](https://github.com/partcad/devcontainers-features/actions/workflows/test.yaml) ## Features @@ -10,7 +10,7 @@ { "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { - "ghcr.io/deepspacecartel/devcontainers-features/apt:2": { + "ghcr.io/partcad/devcontainers-features/apt:2": { "packages": "shellcheck shfmt" } } @@ -28,7 +28,7 @@ Install `pre-commit` via PIP Installs Packages: "PATH": "${containerEnv:PATH}:/opt/pip/bin" }, "features": { - "ghcr.io/deepspacecartel/devcontainers-features/pip:2": { + "ghcr.io/partcad/devcontainers-features/pip:2": { "packages": "pre-commit", "location": "/opt/pip", } @@ -57,7 +57,7 @@ The minimal, blazing-fast, and infinitely customizable prompt for any shell! { "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { - "ghcr.io/deepspacecartel/devcontainers-features/starship:2": { + "ghcr.io/partcad/devcontainers-features/starship:2": { "version": "latest" } } @@ -71,7 +71,7 @@ Since `starship` is managed by configuration files in `$HOME` consider using the "customizations": { "vscode": { "settings": { - "dotfiles.repository": "deepspacecartel/dotfiles" + "dotfiles.repository": "partcad/dotfiles" } } } @@ -84,7 +84,7 @@ If you are using `devcontainers-features/apt` as well then you might have to add { "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { - "ghcr.io/deepspacecartel/devcontainers-features/starship:2": { + "ghcr.io/partcad/devcontainers-features/starship:2": { "version": "latest" } } @@ -148,7 +148,7 @@ devcontainers-features on  main +/- [😵] Consider using along with: -* +* ## Development @@ -158,20 +158,49 @@ Run local checks: pre-commit run --hook-stage manual ``` -Upload packages +Generate docs: ```bash -devcontainer features publish --namespace deepspacecartel/devcontainers-features src/ +devcontainer features generate-docs --namespace partcad/devcontainers-features --project-folder src/ ``` -Generate docs: +Generate `GITHUB_TOKEN` at: + +* + +Upload packages ```bash -devcontainer features generate-docs --namespace deepspacecartel/devcontainers-features --project-folder src/ +devcontainer features package src/ +devcontainer features publish --namespace partcad/devcontainers-features src/ ``` +### Initial Release + +Navigate to: + +* https://github.com/orgs/partcad/packages + +And from there go to "Package Settings" for each of: + +* https://github.com/orgs/partcad/packages/container/package/devcontainers-features +* https://github.com/orgs/partcad/packages/container/package/devcontainers-features%2Fstarship +* https://github.com/orgs/partcad/packages/container/package/devcontainers-features%2Fpip +* https://github.com/orgs/partcad/packages/container/package/devcontainers-features%2Fapt + +In Organisation [Settings / Packages](https://github.com/organizations/partcad/settings/packages) check `Public` and then: + +* In "Manage Actions access" section add `devcontainers-features` repo with `Write` role. +* In "Manage Codespaces access" section add `partcad` repo. +* In "Danger Zone" use "Change visability" to set package visibility to "Public". +* In "Inherited Access" check "Inherit access from source repository (recommended)". + ## TODO * [ ] [Update collection-index.yml #453](https://github.com/devcontainers/devcontainers.github.io/pull/453). * [ ] Integrate `starship completions $(basename $SHELL)`. * [ ] Extract `bash-completion` installation into `utils` package. +* [ ] Create a dedicated team and grant admin permissions to Container Packages. +* [ ] Manage Packages permissions with Terraform. +* [ ] `LABEL org.ope,ncontainers.image.source https://github.com/OWNER/REPO` + * [ ] Maybe `customizations` could be used for that but docs are not clear. diff --git a/src/apt/README.md b/src/apt/README.md index 8c8ae17..9dc2968 100644 --- a/src/apt/README.md +++ b/src/apt/README.md @@ -7,7 +7,7 @@ Install apt packages via JSON or apt.txt ```json "features": { - "ghcr.io/deepspacecartel/devcontainers-features/apt:2": {} + "ghcr.io/partcad/devcontainers-features/apt:2": {} } ``` diff --git a/src/pip/README.md b/src/pip/README.md index fae58f1..f803146 100644 --- a/src/pip/README.md +++ b/src/pip/README.md @@ -7,7 +7,7 @@ Install Python packages via JSON or requirements.txt ```json "features": { - "ghcr.io/deepspacecartel/devcontainers-features/pip:2": {} + "ghcr.io/partcad/devcontainers-features/pip:2": {} } ``` diff --git a/src/pip/devcontainer-feature.json b/src/pip/devcontainer-feature.json index 3fcf6b8..90465d1 100644 --- a/src/pip/devcontainer-feature.json +++ b/src/pip/devcontainer-feature.json @@ -23,12 +23,12 @@ } }, "dependsOn": { - "ghcr.io/deepspacecartel/devcontainers-features/apt:1": { + "ghcr.io/partcad/devcontainers-features/apt:1": { "packages": "python3-pip python3-venv" } }, "installsAfter": [ "ghcr.io/devcontainers/features/common-utils", - "ghcr.io/deepspacecartel/devcontainers-features/apt" + "ghcr.io/partcad/devcontainers-features/apt" ] } diff --git a/src/starship/README.md b/src/starship/README.md index 4fc9c64..aa9672a 100644 --- a/src/starship/README.md +++ b/src/starship/README.md @@ -7,7 +7,7 @@ The minimal, blazing-fast, and infinitely customizable prompt for any shell! ```json "features": { - "ghcr.io/deepspacecartel/devcontainers-features/starship:2": {} + "ghcr.io/partcad/devcontainers-features/starship:2": {} } ``` diff --git a/src/starship/devcontainer-feature.json b/src/starship/devcontainer-feature.json index a64cbbd..1d65147 100644 --- a/src/starship/devcontainer-feature.json +++ b/src/starship/devcontainer-feature.json @@ -32,7 +32,7 @@ }, "dependsOn": { "ghcr.io/devcontainers/features/common-utils": {}, - "ghcr.io/deepspacecartel/devcontainers-features/apt:1": { + "ghcr.io/partcad/devcontainers-features/apt:1": { "packages": "bash-completion" } } From f2e71c16ef76d96fe53c6118a4ba1ad1d3c6da2d Mon Sep 17 00:00:00 2001 From: Alexander Ilyin Date: Thu, 19 Dec 2024 06:10:16 +0000 Subject: [PATCH 2/3] Allow to run release workflow from 'transfer' branch. --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d0ed9ca..f92f85f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,7 +4,7 @@ on: jobs: deploy: - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/transfer' }} runs-on: ubuntu-latest permissions: contents: write From 5d203614412c3c05985181261f1a8e55c9c03f45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Dec 2024 06:28:05 +0000 Subject: [PATCH 3/3] Automated documentation update [skip ci] --- src/apt/README.md | 2 +- src/pip/README.md | 2 +- src/starship/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apt/README.md b/src/apt/README.md index 9dc2968..5aad252 100644 --- a/src/apt/README.md +++ b/src/apt/README.md @@ -21,4 +21,4 @@ Install apt packages via JSON or apt.txt --- -_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ +_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/partcad/devcontainers-features/blob/main/src/apt/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/pip/README.md b/src/pip/README.md index f803146..3da229c 100644 --- a/src/pip/README.md +++ b/src/pip/README.md @@ -22,4 +22,4 @@ Install Python packages via JSON or requirements.txt --- -_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ +_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/partcad/devcontainers-features/blob/main/src/pip/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/starship/README.md b/src/starship/README.md index aa9672a..ef1697d 100644 --- a/src/starship/README.md +++ b/src/starship/README.md @@ -25,4 +25,4 @@ The minimal, blazing-fast, and infinitely customizable prompt for any shell! --- -_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._ +_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/partcad/devcontainers-features/blob/main/src/starship/devcontainer-feature.json). Add additional notes to a `NOTES.md`._