KusionStack / konfig

Shared repository of application models and components, and CI suite for GitOps workflows
Apache License 2.0
27 stars 32 forks source link

Remove the golden.yaml files in the konfig repo #62

Closed amyXia1994 closed 1 year ago

amyXia1994 commented 1 year ago

Background

Those golden files are used mainly for the smoking test, listing affected stacks and displaying the expected YAML diffs in the PR CI progress. But the downsides are appearing:

For all the above reasons, The golden files need to be removed from the repo, on the premise that all the usages of them are reserved:

Furthermore, the stability of the code in konfig still needs to be enhanced by unit and end-to-end tests. That will be discussed in issue: todo

Solution

image

Tools

Update: kusion compile

Current

usage is:kusion compile -w <stackPath>. When the -o option is not specified, the command will by default output to the ci-test/stdout.golden.yaml file.

Update to

Optimize: kusion deps

The kusion deps tools should be optimized to identify the configuration changes more precisely, so to reduce the re-compile time, then improve the local and the CI efficiency.

Current

The dependency analysis is based on the import relationship between files.

Update to

The kusion deps tool should support attribute-level dependency analysis.

Update: CI

The CI pipeline needs to support listing affected stacks and the diff details:

Update: Konfig script

Add: Kusion IDE

Kusion IDE needs to provide convenient user interaction based on the above tools:

live preview of app configuraiton's Yaml representation

the feature is detailed in: https://github.com/KusionStack/vscode-kcl/issues/14

Provide a preview Yaml output panel when the user's active editor is at a base.k/main.k file under a stack:

filter and focus on the changed stacks to provide a local review

Provide filters when displaying the konfig apps:

change review panel

If the repo is adopting a source control, the Kusion IDE needs to add a panel to display the changed stack list and a left-to-right Yaml diff of stacks, so users could review these changes before committing.

The related components need to be updated

There are some components that are aware of or rely on the stdout.golden.yaml files. They need to be updated before the golden files are finally removed from the konfig repo:

During the migration, deprecated warnings could be widely used to inform users to migrate to the new process. And users should be announced before the changes are public released.

Phased Goals

stage 1:

stage 2:

Peefy commented 1 year ago

U can move this issue into the konfig repo.

jakezhu9 commented 1 year ago

I completely agree with you! Your suggestion about improving tests and enhancing user experience is fantastic.

By the way, are there any updates or progress regarding this issue? I believe it's important and we should try to speed up the process.