Skip to content

chore: add dev workshop - #6263

Open
lengau wants to merge 11 commits into
mainfrom
work/workshop
Open

chore: add dev workshop#6263
lengau wants to merge 11 commits into
mainfrom
work/workshop

Conversation

@lengau

@lengau lengau commented May 27, 2026

Copy link
Copy Markdown
Contributor

This adds a new dev workshop for developing snapcraft. Mostly this just uses Workshop to expose the major parts of the Makefile nicely (and of course to set up your workshop), but it also adds two new workshop actions for the dev environment:

install-branch: Install packages from git branches or URLs

  • Supports short package names like craft-parts (defaults to canonical org)
  • Supports full git URLs for any repository
  • Usage: workshop run -- install-branch craft-parts main

lock: Run uv lock with custom arguments and update setup

  • Automatically runs make setup after locking dependencies
  • Usage: workshop run -- lock or workshop run -- lock --refresh

These actions improve the dev workflow by making dependency management and testing against branches easier.

@lengau
lengau requested review from bepri and mr-cal as code owners May 27, 2026 19:47
@lengau
lengau marked this pull request as draft May 27, 2026 19:47
@lengau lengau changed the title Add workshop actions: install-branch and lock chore: add dev workshop May 27, 2026
lengau and others added 3 commits May 27, 2026 21:56
- install-branch: Install packages from git branches or URLs
  Supports both short names (craft-parts) and full URLs
  Defaults to canonical org for short names

- lock: Run uv lock with custom arguments and update setup
  Automatically runs make setup after locking dependencies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lengau
lengau marked this pull request as ready for review May 27, 2026 19:57

@medubelko medubelko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include a description and the basic usage in docs/contribute/development.rst? You can mark it with a WIP admonition (!).

@lengau
lengau requested a review from a team as a code owner May 27, 2026 20:40
@lengau
lengau requested a review from medubelko May 27, 2026 20:41

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/contribute/development.rst Outdated
Comment thread docs/contribute/development.rst Outdated
all tools and dependencies pre-installed. It's an alternative to the local
environment described in the previous section.

When the workshop starts, it automatically runs ``make setup`` inside the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the user start it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a bit more, and I've ended this section with a link to the Workshop tutorial.

Comment thread docs/contribute/development.rst Outdated

Two additional helpers support dependency work.

``lock`` runs ``uv lock`` with any arguments you pass, then re-runs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``lock`` runs ``uv lock`` with any arguments you pass, then re-runs
The ``lock`` helper runs ``uv lock`` with any arguments you pass, then re-runs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the clear light of day I'm changing these to "actions" (including replacing it above).

Comment thread docs/contribute/development.rst Outdated
@lengau
lengau requested a review from medubelko May 28, 2026 07:10
Comment thread .workshop/dev.yaml
Comment on lines +11 to +12
lint: make lint
format: make format

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My puter 'splodes whenever I try to run either of these:

❯ workshop run -- format
success=true
ruff check --fix  snapcraft tests || success=false
ruff format  snapcraft tests
$success || exit 1
error: Failed to initialize cache at /var/lib/snapd/void/.ruff_cache: Permission denied (os error 13)
E902 No such file or directory (os error 2)
--> snapcraft:1:1

E902 No such file or directory (os error 2)
--> tests:1:1

Found 2 errors.
error: Failed to initialize cache at /var/lib/snapd/void/.ruff_cache: Permission denied (os error 13)
error: Failed to format snapcraft: No such file or directory (os error 2)
error: Failed to format tests: No such file or directory (os error 2)
make: *** [common.mk:107: format-ruff] Error 2


❯ workshop run -- lint
ruff check  snapcraft tests
ruff format --diff  snapcraft tests
error: Failed to initialize cache at /var/lib/snapd/void/.ruff_cache: Permission denied (os error 13)
E902 No such file or directory (os error 2)
--> snapcraft:1:1

E902 No such file or directory (os error 2)
--> tests:1:1

Found 2 errors.
make: *** [common.mk:129: lint-ruff] Error 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@lengau
lengau requested a review from bepri May 29, 2026 20:32

@bepri bepri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

@mr-cal mr-cal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it works great!

Unless you use worktrees, in which case it doesn't work!! 😠 (worktree bug incoming)

Comment on lines +86 to +90
With the `Workshop Snap <https://snapcraft.io/workshop>`__ installed, start the
development environment by running ``workshop launch dev`` from within the Snapcraft
directory. When the workshop starts, it automatically runs ``make setup`` inside the
container. From there, use the pre-configured actions to carry out common
development tasks:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the inline command is easy to skim over when the rest of the commands are code-blocked:

Suggested change
With the `Workshop Snap <https://snapcraft.io/workshop>`__ installed, start the
development environment by running ``workshop launch dev`` from within the Snapcraft
directory. When the workshop starts, it automatically runs ``make setup`` inside the
container. From there, use the pre-configured actions to carry out common
development tasks:
With the `Workshop Snap <https://snapcraft.io/workshop>`__ installed, start the
development environment from within the Snapcraft directory:
.. code-block:: bash
workshop launch dev
When the workshop starts, it automatically runs ``make setup`` inside the
container. From there, use the pre-configured actions to carry out common
development tasks:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants