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

fix: Add Markers and Move Comments for API Docs #1802

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/apis/build/v1beta1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@ type BuildStatus struct {

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Build is the Schema representing a Build definition
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:resource:path=builds,scope=Namespaced
Expand All @@ -327,6 +326,8 @@ type BuildStatus struct {
// +kubebuilder:printcolumn:name="BuildStrategyKind",type="string",JSONPath=".spec.strategy.kind",description="The BuildStrategy type which is used for this Build"
// +kubebuilder:printcolumn:name="BuildStrategyName",type="string",JSONPath=".spec.strategy.name",description="The BuildStrategy name which is used for this Build"
// +kubebuilder:printcolumn:name="CreationTime",type="date",JSONPath=".metadata.creationTimestamp",description="The create time of this Build"

// Build is the Schema representing a Build definition
type Build struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -336,6 +337,7 @@ type Build struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true

// BuildList contains a list of Build
type BuildList struct {
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/build/v1beta1/buildrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,16 @@ type FailureDetails struct {

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// BuildRun is the Schema representing an instance of build execution
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:resource:path=buildruns,scope=Namespaced,shortName=br;brs
// +kubebuilder:printcolumn:name="Succeeded",type="string",JSONPath=".status.conditions[?(@.type==\"Succeeded\")].status",description="The Succeeded status of the BuildRun"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type==\"Succeeded\")].reason",description="The Succeeded reason of the BuildRun"
// +kubebuilder:printcolumn:name="StartTime",type="date",JSONPath=".status.startTime",description="The start time of this BuildRun"
// +kubebuilder:printcolumn:name="CompletionTime",type="date",JSONPath=".status.completionTime",description="The completion time of this BuildRun"

// BuildRun is the Schema representing an instance of build execution
type BuildRun struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -286,6 +287,7 @@ type BuildRun struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true

// BuildRunList contains a list of BuildRun
type BuildRunList struct {
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/build/v1beta1/buildstrategy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ const (

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// BuildStrategy is the Schema representing a strategy in the namespace scope to build images from source code.
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:resource:path=buildstrategies,scope=Namespaced,shortName=bs;bss

// BuildStrategy is the Schema representing a strategy in the namespace scope to build images from source code.
type BuildStrategy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -37,6 +38,7 @@ type BuildStrategy struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true

// BuildStrategyList contains a list of BuildStrategy
type BuildStrategyList struct {
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/build/v1beta1/clusterbuildstrategy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ const (
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterBuildStrategy is the Schema representing a strategy in the cluster scope to build images from source code.
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:resource:path=clusterbuildstrategies,scope=Cluster,shortName=cbs;cbss

// ClusterBuildStrategy is the Schema representing a strategy in the cluster scope to build images from source code.
type ClusterBuildStrategy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -38,6 +39,7 @@ type ClusterBuildStrategy struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true

// ClusterBuildStrategyList contains a list of ClusterBuildStrategy
type ClusterBuildStrategyList struct {
Expand Down
3 changes: 0 additions & 3 deletions pkg/apis/build/v1beta1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

// NOTE: Boilerplate only. Ignore this file.

// Package v1beta1 contains API Schema definitions for the build v1beta1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=shipwright.io
Comment on lines -7 to -9
Copy link
Member

Choose a reason for hiding this comment

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

I honestly do not fully know what those annotations are for, but as you had not specifically mentioned it, I'd like to make sure this was intentionally removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this was intentionally removed. The markers are duplicated in doc.go, and I verified that removing this didn't change how the CRDs were generated.

package v1beta1

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/build/v1beta1/trigger.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright The Shipwright Contributors
//
// SPDX-License-Identifier: Apache-2.0

package v1beta1

// Trigger represents the webhook trigger configuration for a Build.
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/build/v1beta1/trigger_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright The Shipwright Contributors
//
// SPDX-License-Identifier: Apache-2.0

package v1beta1

// TriggerType set of TriggerWhen valid names.
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/build/v1beta1/trigger_when.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright The Shipwright Contributors
//
// SPDX-License-Identifier: Apache-2.0

package v1beta1

// TriggerWhen a given scenario where the webhook trigger is applicable.
Expand Down
Loading