Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign Project models #4885

Open
mr-cal opened this issue Jun 28, 2024 · 1 comment
Open

Redesign Project models #4885

mr-cal opened this issue Jun 28, 2024 · 1 comment
Assignees
Labels
enhancement New features or optimizations triaged

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented Jun 28, 2024

What needs to get done

Create a base Project model and a set of inherited models for each base and snap type.

Some pseudocode from @lengau:

class Project: ...

class BaseProject(Project): 
    type: Literal["base"]
    build-base: BaseEnum
class AppProject(Project):
    base: BaseEnum
class BareProject(AppProject):
    base: BaseEnum.BARE
class Core22Project(AppProject):
    base: BaseEnum.CORE22
class Core22KernelProject(Core22Project):
    type: kernel

UnionAppProject = ...
UnionKernelProject = ...
SnapcraftProject = Annotated[
    BaseProject | SnapdProject | GadgetProject | UnionAppProject | UnionKernelProject,
    Field(discriminator="type")
]

Why it needs to get done

Snapcraft has a single Project model with declarative validation like "if base is core24, then architectures is not allowed".

This needs a more sophisticated approach:

  • To make the Project models maintainable and extensible
  • To allow parsing core20 snaps for remote builds
  • To allow for accurate json schemas per-base
@mr-cal mr-cal self-assigned this Jun 28, 2024
@mr-cal mr-cal added the triaged label Jul 3, 2024
mr-cal added a commit that referenced this issue Jul 6, 2024
…er (#4895)

Requires core20 snaps to use the legacy remote builder because the new
remote builder cannot parse core20 `snapcraft.yaml` files (#4885).

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
farshidtz pushed a commit to farshidtz/snapcraft that referenced this issue Jul 18, 2024
…er (canonical#4895)

Requires core20 snaps to use the legacy remote builder because the new
remote builder cannot parse core20 `snapcraft.yaml` files (canonical#4885).

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
farshidtz added a commit to farshidtz/snapcraft that referenced this issue Jul 18, 2024
commit d65754b
Author: Callahan Kovacs <callahan.kovacs@canonical.com>
Date:   Wed Jul 17 10:57:51 2024 -0500

    feat(extensions): pass app name to `get_app_snippet()`

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit fa1043d
Author: Callahan <callahan.kovacs@canonical.com>
Date:   Tue Jul 16 13:56:22 2024 -0500

    tests: disable `build-base: devel` spread tests (canonical#4922)

    Disable `build-base: devel` spread tests until we have the resources to
    debug the underlying issue with 24.10 buildd images and
    `systemd-resolved` (canonical#4921).

    We should be able to address this issue in 2024-Nov.

    Fixes canonical#4910
    (CRAFT-3105)

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit de7f1d5
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jul 15 17:36:49 2024 -0500

    build(deps): bump zipp from 3.17.0 to 3.19.1 (canonical#4901)

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit ccbc7b3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jul 15 14:27:32 2024 -0500

    build(deps): bump certifi from 2023.7.22 to 2024.7.4 in /docs/.sphinx (canonical#4903)

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Callahan <callahan.kovacs@canonical.com>

commit 91fa63c
Author: Callahan <callahan.kovacs@canonical.com>
Date:   Mon Jul 15 07:11:41 2024 -0500

    docs: add explanation, reference, and how to for bases (canonical#4900)

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit 011dd11
Author: Callahan <callahan.kovacs@canonical.com>
Date:   Fri Jul 12 16:15:52 2024 -0500

    docs: add explanation, how-to, and reference for components (canonical#4904)

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit f313611
Author: Sergio Schvezov <sergio.schvezov@canonical.com>
Date:   Wed Jul 10 16:07:49 2024 -0300

    chore: add sorted flake8 and pylint for tiobe/tics

    Sorting proved useful in removing dups like pycodestyle

commit 6cbdff6
Author: Sergio Schvezov <sergio.schvezov@canonical.com>
Date:   Wed Jul 10 15:03:33 2024 -0300

    ci: use native Ubuntu python for tests

    Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>

commit fb1834c
Author: Scarlett Gately Moore <sgmoore@debian.org>
Date:   Wed Jul 10 12:18:14 2024 -0700

    feat(extensions): add content interfaces for qt-common-themes to KDE Neon 6 (canonical#4884)

commit ccba428
Author: Sergio Schvezov <sergio.schvezov@canonical.com>
Date:   Wed Jul 10 14:01:53 2024 -0300

    ci: use correct attribute for tics workflow (canonical#4906)

commit 74b7b75
Author: Sergio Schvezov <sergio.schvezov@canonical.com>
Date:   Wed Jul 10 09:28:36 2024 -0300

    ci: set the branchdir for TICS

commit 0668b6c
Author: Sergio Schvezov <sergio.schvezov@canonical.com>
Date:   Mon Jul 8 16:55:44 2024 -0300

    fix: setup Python env for tiobe ci

    Also shallow checkout like the other workflows

commit a4e2895
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jul 8 12:55:02 2024 -0500

    build(deps): bump certifi from 2023.11.17 to 2024.7.4 (canonical#4896)

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 1d17810
Author: Callahan <callahan.kovacs@canonical.com>
Date:   Mon Jul 8 08:37:34 2024 -0500

    build(deps): add 'validators' to install_requires (canonical#4898)

    `validators` was added in canonical#4888 to the requirement files but
    not to `setup.py`

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit d9c8781
Author: Callahan <callahan.kovacs@canonical.com>
Date:   Fri Jul 5 22:24:52 2024 -0500

    fix(remotebuild): require core20 snaps to use the legacy remote builder (canonical#4895)

    Requires core20 snaps to use the legacy remote builder because the new
    remote builder cannot parse core20 `snapcraft.yaml` files (canonical#4885).

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit 124c932
Author: Callahan Kovacs <callahan.kovacs@canonical.com>
Date:   Tue Jul 2 15:48:31 2024 -0500

    tests(remotebuild): add per-base remote-build spread tests

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit 3325af0
Author: Callahan Kovacs <callahan.kovacs@canonical.com>
Date:   Wed Jul 3 13:30:06 2024 -0500

    feat(remotebuild): allow build-for all

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit c1c70a2
Author: Callahan Kovacs <callahan.kovacs@canonical.com>
Date:   Tue Jul 2 14:37:49 2024 -0500

    fix(remotebuild): use legacy launchpad credentials if they exist

    If the legacy remote-build credentials exist and the new credentials do
    not, emit a deprecation warning and use the legacy credentials.

    Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>

commit 4bb948b
Author: Callahan Kovacs <callahan.kovacs@canonical.com>
Date:   Tue Jul 2 12:41:40 2024 -0500

    build(deps): bump craft libraries

commit fad8df3
Author: সৌম্যদীপ ঘোষ <72045785+soumyaDghosh@users.noreply.github.com>
Date:   Sat Jul 6 00:46:47 2024 +0530

    fix: validate appstream metadata links and prefer links from project metadata (canonical#4888)

    - Validate that update_contact, donation, vcs-browser, bugtracker, and homepage
      fields adopted from an appstream metadata file are valid URLs or email addresses.
    - Contact, donation, source-code, issues, and website fields in a snapcraft.yaml take
      priority over appstream metadata

commit 4f3c19d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 2 14:20:18 2024 -0400

    build(deps): bump urllib3 from 1.26.18 to 1.26.19 in /docs/.sphinx (canonical#4887)
@mr-cal mr-cal added the enhancement New features or optimizations label Aug 13, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3223.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or optimizations triaged
Projects
None yet
Development

No branches or pull requests

1 participant