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

[FEATURE] 1rst version of a CUE-based Dashboard-as-Code framework #1664

Merged
merged 16 commits into from
Jan 5, 2024

Conversation

AntoineThebaud
Copy link
Contributor

@AntoineThebaud AntoineThebaud commented Dec 19, 2023

Description

This PR brings a first version of what we can call a Dashboard-as-Code framework. More precisely:

  • helper libs, available at cue/dac-utils
  • helper script for dependencies setup (no real dependency management available in CUE for the moment so have to go this way as a workaround..)
  • user guide

Besides, for the "internal" part of this PR:

  • new target cue-gen added to Makefile to generate the CUE definitions from to the Golang datamodel. This is needed for the DaC framework validation (= new tests associated to cue-test target)
  • to better organize the code I gathered the new DaC utilities & existing plugin schemas in a new cue folder at the root, so I had to update many files to update the schemas paths accordingly.
  • CUE definition patches, in order to fill the gaps of the cue get go generation (see comments in the files for more details)

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

@AntoineThebaud AntoineThebaud force-pushed the antoinethebaud/DaC-part1 branch 10 times, most recently from 842313c to 9ae1669 Compare December 22, 2023 10:27
@AntoineThebaud AntoineThebaud changed the title [WIP] 1rst step towards a CUE-based Dashboard-as-Code framework [FEATURE] 1rst version of a CUE-based Dashboard-as-Code framework Dec 22, 2023
@AntoineThebaud AntoineThebaud force-pushed the antoinethebaud/DaC-part1 branch 2 times, most recently from 8101114 to b02a73b Compare December 22, 2023 12:21
@AntoineThebaud AntoineThebaud marked this pull request as ready for review December 22, 2023 12:21
Copy link
Member

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

Amazing work already !

I think we can simplify the setup by saving in the perses repo the cue files generated and by adding a dac subcommand in the CLI !

-v version of Perses (in the form of \"X.Y.Z\") from which to retrieve the dependencies

Example:
$ ./dac_setup.sh -v 0.42.1"
Copy link
Member

Choose a reason for hiding this comment

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

to ease the cross platform support, why not including that in the CLI ?

like under the command percli dac init --language=cue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes since we already planned to add such dac subcommand in the CLI for other stuff, I was thinking of something like this but for a next PR, but yes we can already do this move if you want

scripts/dac_setup.sh Outdated Show resolved Hide resolved
docs/user-guides/dashboard-as-code.md Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
cue/dac-utils/panel-group.cue Outdated Show resolved Hide resolved
@AntoineThebaud AntoineThebaud changed the base branch from main to feat/dashboard-as-code January 3, 2024 15:52
Copy link
Member

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

so cool, that's a really nice start !!

As a side note I think you need to re-generate the cue files with the new URL type we added in the pkg /model/api/v1/common

pkg/model/api/v1/metadata.cue Outdated Show resolved Hide resolved
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
…e base CUE definitions + integrate DaC validation in `make cue-test`

Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
… + improve dac test to show precise diff when fail

Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
…ate import paths accordingly

Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
…E files in `make fmt` + fix formatting + exclude *_go_gen.cue files from license check

Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
…val` covering all files with 1 command + less diff in makefile

Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
@AntoineThebaud AntoineThebaud changed the base branch from feat/dashboard-as-code to main January 5, 2024 15:12
@AntoineThebaud AntoineThebaud changed the base branch from main to feat/dashboard-as-code January 5, 2024 15:12
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
@AntoineThebaud AntoineThebaud merged commit f9e99f5 into feat/dashboard-as-code Jan 5, 2024
18 checks passed
@AntoineThebaud AntoineThebaud deleted the antoinethebaud/DaC-part1 branch January 5, 2024 15:45
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.

None yet

2 participants