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

docs: working with stages documentation #2608

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

fykaa
Copy link
Contributor

@fykaa fykaa commented Sep 30, 2024

fixes #2339

image

@fykaa fykaa self-assigned this Sep 30, 2024
@fykaa fykaa requested review from a team as code owners September 30, 2024 12:05
Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 2410cc3
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/66fa97cbc33f3f0008a38c03
😎 Deploy Preview https://deploy-preview-2608.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.92%. Comparing base (c09fec4) to head (8aa7ab5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2608   +/-   ##
=======================================
  Coverage   50.92%   50.92%           
=======================================
  Files         279      279           
  Lines       25180    25180           
=======================================
  Hits        12823    12823           
  Misses      11666    11666           
  Partials      691      691           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@krancour
Copy link
Member

krancour commented Oct 8, 2024

This feels misplaced. Scanning the rest of the concepts doc, there are no other occurrences of demonstrating CLI commands. I think we should keep this page focused on concepts and how they map to CRDs. This raises the question of where this documentation of kargo verify belongs, and I would suggest it calls for the creation of a "Working with Stages" guide similar to the "Working with Freight" guide. This will hopefully also help advance us farther toward the longer term goal of organizing the doc tree to have separate branches for user topics and operator topics.

@krancour krancour removed this from the v1.0.0 milestone Oct 11, 2024
@krancour krancour added this to the Live Docs milestone Oct 24, 2024
Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 8aa7ab5
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/673b4c9be2b5ff00088d4f9f
😎 Deploy Preview https://deploy-preview-2608.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sidebar_label: Working with stage
---

# Working With Stage
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Working With Stage
# Working With Stages

Copy link
Member

Choose a reason for hiding this comment

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

See this comment on another PR.

This aligns nicely with what I was suggesting there.

Doubling down on that, I think there are parts of the concepts doc that should move to this new page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Working With Stages

Just wondering, we want to call it "Working with Stages" because usually there will be more than 1 Stage user will be working with. Should we also rename "Working with Freight" to "Working with Freights" for keeping it consistent?

Copy link
Member

Choose a reason for hiding this comment

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

No. Grammatically, "Freight" is a mass noun. This is why you may often see phrases like "a piece of Freight" or "two pieces of Freight" to add units where none are otherwise specified.

Not everyone is aware of this, so you'll doubtlessly encounter places in the code or docs where "Freights" is used, but it is grammatically incorrect. It may also appear in generated code because the tools in question don't understand mass nouns.

As far as documentation is concerned, we should strive for grammatical correctness when we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it!

Comment on lines 300 to 310
To manage this verification process for `Stage`s you can use the `kargo verify` command. It allows you to rerun or abort the verification of a `Stage`'s current `Freight`.

To rerun the verification for `test` `Stage`:
```shell
kargo verify stage --project=kargo-demo test
```

If you need to stop an ongoing verification process in a `Stage`, you can use the `--abort` flag:
```shell
kargo verify stage --project=kargo-demo test --abort
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This contains details regarding the kargo verify command.

Instead of separating CRD and CLI information, as we discussed in the previous meeting, I have put it back with other information from the Verification section.

Copy link
Member

@krancour krancour Nov 15, 2024

Choose a reason for hiding this comment

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

This still feels misplaced. Everything up to this point in the page has discussed the structure of the Stage type and now, all of the sudden, we're jumping into CLI usage. And then after this, we're right back to discussing structure. It doesn't fit.

See this comment about improving how the page is organized.

Comment on lines 412 to 420
## Refresh

Refreshing a `Stage` helps update its state based on any new changes in `Freight` or configuration. By refreshing, you can ensure that the `Stage` reflects the latest deployment status or artifact updates.

```shell
kargo refresh stage --project=kargo-demo staging
```

Running this command updates the `staging` `Stage` of the `kargo-demo` project to reflect the most recent `Freight` or configuration changes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This contains details regarding the refresh command.
If this does not need to be documented, please let me know.

Copy link
Member

Choose a reason for hiding this comment

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

It's worth documenting, but as noted in other comments, let's pull verification details down to here as well and also add docs for other important Stage-related commands.

@fykaa fykaa requested a review from krancour November 5, 2024 10:24
Signed-off-by: Faeka Ansari <[email protected]>
@@ -46,6 +46,10 @@ directed acyclic graph to describe a delivery pipeline. Typically, such a
pipeline may feature a "test" or "dev" stage as its starting point, with one or
more "prod" stages at the end.

:::note
For more information on the Stage Resource, refer to [Working with Stages](./30-how-to-guides/14-working-with-stages.md).
Copy link
Member

@krancour krancour Nov 15, 2024

Choose a reason for hiding this comment

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

Suggested change
For more information on the Stage Resource, refer to [Working with Stages](./30-how-to-guides/14-working-with-stages.md).
For technical details of the corresponding `Stage` resource type, refer to [Working with Stages](./30-how-to-guides/14-working-with-stages.md).

@@ -0,0 +1,421 @@
---
description: Learn how to work effectively with stages
sidebar_label: Working with stages
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sidebar_label: Working with stages
sidebar_label: Working with Stages

# Working With Stages

Each Kargo Stage is represented by a Kubernetes resource of type `Stage`.

Copy link
Member

@krancour krancour Nov 15, 2024

Choose a reason for hiding this comment

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

Suggested change
## The `Stage` Resource Type

Adding this fixes a couple problems:

  1. The heading levels are off by one throughout the doc, but adding this makes them right.
  2. This page now fundamentally covers two things that are deserving of separate sections:
    1. Important info on how a Stage is structured
    2. How to interact with them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, so

  1. The Stage resource type includes the Stage's structure, such as requestedFreight, promotionTemplate, Verifications, status.
  2. Interacting with Stage will cover Refresh and verification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 2abef8f


Each Kargo Stage is represented by a Kubernetes resource of type `Stage`.

A `Stage` resource's `spec` field decomposes into three main areas of concern:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A `Stage` resource's `spec` field decomposes into three main areas of concern:
Like most Kubernetes resources, a `Stage` is composed of a user-defined `spec` field and a system-populated `status` field.
A `Stage` resource's `spec` field is itself composed of three main areas of concern:


* Verification

The following sections will explore each of these in greater detail.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The following sections will explore each of these in greater detail.
The following sections will explore each these `spec` sections as well as `status` in greater detail.

Comment on lines 122 to 126
By requesting `Freight` from multiple sources, a `Stage` can effectively
participate in _multiple pipelines_ that may each deliver different collections
of artifacts independently of the others. At present, this is most useful for
the delivery of microservices that are developed and deployed in parallel,
although other uses of this feature are anticipated in the future.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
By requesting `Freight` from multiple sources, a `Stage` can effectively
participate in _multiple pipelines_ that may each deliver different collections
of artifacts independently of the others. At present, this is most useful for
the delivery of microservices that are developed and deployed in parallel,
although other uses of this feature are anticipated in the future.
By requesting `Freight` from multiple sources, a `Stage` can effectively
participate in _multiple pipelines_ that may each deliver different collections
of artifacts independently of the others.

Removing this because we're already seeing this used in a number of different ways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to mention other use cases as well, including microservices, to showcase the broader applicability? Or should we keep it more general and let users infer potential use cases on their own?

observedGeneration: 1
phase: Steady
```

Copy link
Member

Choose a reason for hiding this comment

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

Right here seems to be the right place to add something like ## Interacting with Stages.

You can show how to create, delete, and refresh Stages. Info on promoting to a Stage probably belongs in a not-yet-written "Working with Promotions" page, so I would not include it here (but you can link to it later when it exists). Verifying the Stage's current Freight could also be discussed here. i.e. Refer back to this comment and relocate those details to this new section.

For each of create, delete, refresh, and verify, you can show how these can be accomplished with either the UI or CLI.

Copy link
Member

Choose a reason for hiding this comment

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

Let's use tabs for separating UI instructions and CLI instructions. UI as the default.

The instructions do not need to be super in-depth. i.e. You do not need to walk the reader through defining a Stage. They've already worked their way through sections about how they are structured. That information need not be repeated. Just show the relevant commands. Likewise, you do not need to walk through the UI's Stage creation wizard. Just point out how to access it.

@krancour krancour changed the title docs: kargo-verify command docs: working with stages documentation Nov 15, 2024
@fykaa fykaa marked this pull request as draft November 19, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: need to document kargo verify command
2 participants