Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
pull_request:
workflow_dispatch:
# allow manual runs on branches without a PR
# allow manual runs on branches without a PR

env:
FORCE_COLOR: "1"
Expand All @@ -22,12 +22,12 @@ jobs:
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true

- name: "Set up Python"
uses: actions/setup-python@v6
uses: actions/setup-python@v6.2.0
with:
python-version-file: ".python-version"

Expand All @@ -42,15 +42,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true

- name: "Set up Python"
uses: actions/setup-python@v6
uses: actions/setup-python@v6.2.0
with:
python-version-file: ".python-version"

Expand All @@ -65,7 +65,7 @@ jobs:
needs: [lint, tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- name: Build snap
uses: snapcore/action-build@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
- uses: "DeterminateSystems/nix-installer-action@main"
Expand All @@ -39,7 +39,7 @@ jobs:
- ubuntu-24.04-arm
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: snapcore/action-build@v1
id: build
- uses: snapcore/action-publish@v1
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true

- name: "Set up Python"
uses: actions/setup-python@v6
uses: actions/setup-python@v6.2.0
with:
python-version-file: ".python-version"

Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand All @@ -67,7 +67,7 @@ jobs:
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.3.0
uses: sigstore/gh-action-sigstore-python@v3.4.0
with:
inputs: >-
./dist/*.tar.gz
Expand Down
50 changes: 29 additions & 21 deletions dev/snap_01_add_ids.patch
Original file line number Diff line number Diff line change
@@ -1,64 +1,72 @@
--- .build/snapcraft_upstream.json.orig 2025-10-31 14:39:20.642999620 +0100
+++ src/craft_ls/schemas/snapcraft.json 2025-10-31 15:10:13.397566863 +0100
--- snapcraft.json 2026-06-19 13:57:41.806308756 +0200
+++ .build/snapcraft_upstream.json 2026-06-19 14:07:56.295766948 +0200
@@ -1,4 +1,5 @@
{
+ "$id": "#snapcraft",
"$defs": {
"App": {
"additionalProperties": false,
@@ -503,6 +504,7 @@
@@ -522,6 +523,7 @@
"type": "object"
},
"BareCore22Project": {
+ "$id": "urn:snapcraft:bare22",
+ "$id": "urn:snapcraft:bare22",
"additionalProperties": false,
"properties": {
"name": {
@@ -1090,6 +1092,7 @@
@@ -1108,6 +1110,7 @@
"type": "object"
},
"BareCore24Project": {
+ "$id": "urn:snapcraft:bare24",
+ "$id": "urn:snapcraft:bare24",
"additionalProperties": false,
"properties": {
"name": {
@@ -1678,6 +1681,7 @@
@@ -1694,6 +1697,7 @@
"type": "object"
},
"BaseCore22Project": {
+ "$id": "urn:snapcraft:base22",
"BareCore26Project": {
+ "$id": "urn:snapcraft:bare26",
"additionalProperties": false,
"properties": {
"name": {
@@ -2259,6 +2263,7 @@
@@ -2280,6 +2284,7 @@
"type": "object"
},
"BaseCore24Project": {
+ "$id": "urn:snapcraft:base24",
"BareDevelProject": {
+ "$id": "urn:snapcraft:baredevel",
"additionalProperties": false,
"properties": {
"name": {
@@ -2840,6 +2845,7 @@
@@ -2983,6 +2988,7 @@
"type": "object"
},
"BaseDevelProject": {
+ "$id": "urn:snapcraft:devel",
"Core22Project": {
+ "$id": "urn:snapcraft:core22",
"additionalProperties": false,
"properties": {
"name": {
@@ -3555,6 +3561,7 @@
@@ -3578,6 +3584,7 @@
"type": "object"
},
"Core22Project": {
+ "$id": "urn:snapcraft:core22",
"Core24Project": {
+ "$id": "urn:snapcraft:core24",
"additionalProperties": false,
"properties": {
"name": {
@@ -4151,6 +4158,7 @@
@@ -4173,6 +4180,7 @@
"type": "object"
},
"Core24Project": {
+ "$id": "urn:snapcraft:core24",
"Core26Project": {
+ "$id": "urn:snapcraft:core26",
"additionalProperties": false,
"properties": {
"name": {
@@ -4768,6 +4776,7 @@
"type": "object"
},
"DevelBaseProject": {
+ "$id": "urn:snapcraft:basedevel",
"additionalProperties": false,
"properties": {
"name": {
11 changes: 5 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
nox.options.reuse_venv = "yes"
nox.options.sessions = ["fmt", "lint"]

# TODO: Pin versions to tagged release for all tools
CHARM_VERSION = "4.0.1"
SNAP_VERSION = "551a793ae20241db56b7edf9049070a72f5f593b"
ROCK_VERSION = "6553ac9de239be758f5cf648eb65c580709c4fc5"
SNAPCRAFT_URL = f"https://raw.githubusercontent.com/canonical/snapcraft/{SNAP_VERSION}/schema/snapcraft.json"
ROCKCRAFT_URL = f"https://raw.githubusercontent.com/canonical/rockcraft/{ROCK_VERSION}/schema/rockcraft.json"
CHARM_VERSION = "4.2.1"
SNAP_VERSION = "9.0.0"
ROCK_VERSION = "1.19.0"
SNAPCRAFT_URL = f"https://raw.githubusercontent.com/canonical/snapcraft/refs/tags/{SNAP_VERSION}/schema/snapcraft.json"
ROCKCRAFT_URL = f"https://raw.githubusercontent.com/canonical/rockcraft/refs/tags/{ROCK_VERSION}/schema/rockcraft.json"
CHARMCRAFT_URL = f"https://raw.githubusercontent.com/canonical/charmcraft/refs/tags/{CHARM_VERSION}/schema/charmcraft.json"


Expand Down
14 changes: 13 additions & 1 deletion src/craft_ls/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ def get_validator_and_parse( # noqa: C901
.lookup("urn:snapcraft:core24")
.contents
)
case "core26", _:
validator = Draft202012Validator(
schema=snapcraft_registry.resolver()
.lookup("urn:snapcraft:core26")
.contents
)
case "bare", "core22":
validator = Draft202012Validator(
schema=snapcraft_registry.resolver()
Expand All @@ -125,6 +131,12 @@ def get_validator_and_parse( # noqa: C901
.lookup("urn:snapcraft:bare24")
.contents
)
case "bare", "core26":
validator = Draft202012Validator(
schema=snapcraft_registry.resolver()
.lookup("urn:snapcraft:bare26")
.contents
)
case _, "core22":
validator = Draft202012Validator(
schema=snapcraft_registry.resolver()
Expand All @@ -140,7 +152,7 @@ def get_validator_and_parse( # noqa: C901
case _, "devel":
validator = Draft202012Validator(
schema=snapcraft_registry.resolver()
.lookup("urn:snapcraft:devel")
.lookup("urn:snapcraft:basedevel")
.contents
)

Expand Down
21 changes: 17 additions & 4 deletions src/craft_ls/schemas/charmcraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
],
"maxLength": 40,
"minLength": 1,
"pattern": "^([a-z0-9][a-z0-9-]?)*[a-z]+([a-z0-9-]?[a-z0-9])*$",
"title": "Project Name",
"type": "string"
},
Expand Down Expand Up @@ -855,7 +854,6 @@
],
"maxLength": 40,
"minLength": 1,
"pattern": "^([a-z0-9][a-z0-9-]?)*[a-z]+([a-z0-9-]?[a-z0-9])*$",
"title": "Project Name",
"type": "string"
},
Expand Down Expand Up @@ -902,13 +900,16 @@
"ubuntu@20.04",
"ubuntu@22.04",
"ubuntu@24.04",
"ubuntu@24.10",
"ubuntu@25.04",
"ubuntu@25.10",
"almalinux@9"
],
"type": "string"
},
{
"const": "ubuntu@26.04",
"type": "string"
},
{
"type": "null"
}
Expand All @@ -924,7 +925,6 @@
"ubuntu@20.04",
"ubuntu@22.04",
"ubuntu@24.04",
"ubuntu@24.10",
"ubuntu@25.04",
"ubuntu@25.10",
"almalinux@9"
Expand Down Expand Up @@ -991,6 +991,19 @@
]
}
},
"propertyNames": {
"description": "The name of this platform. May not contain '/'",
"examples": [
"riscv64",
"my-special-platform"
],
"not": {
"enum": [
"*",
"any"
]
}
},
"title": "Platforms",
"type": "object"
},
Expand Down
Loading
Loading