Skip to content

Commit

Permalink
Revert "feat: add initiated by in history and rollback view (argoproj…
Browse files Browse the repository at this point in the history
…#16654)"

This reverts commit dfe4ca9

Signed-off-by: ggkhrmv <gg.khrmv@gmail.com>
  • Loading branch information
ggkhrmv committed Jan 15, 2024
1 parent 04afdcb commit d8dc8e2
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 105 deletions.
3 changes: 0 additions & 3 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8658,9 +8658,6 @@
"format": "int64",
"title": "ID is an auto incrementing identifier of the RevisionHistory"
},
"initiatedBy": {
"$ref": "#/definitions/v1alpha1OperationInitiator"
},
"revision": {
"type": "string",
"title": "Revision holds the revision the sync was performed against"
Expand Down
13 changes: 1 addition & 12 deletions controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,16 +880,7 @@ func useDiffCache(noCache bool, manifestInfos []*apiclient.ManifestResponse, sou
return true
}

func (m *appStateManager) persistRevisionHistory(
app *v1alpha1.Application,
revision string,
source v1alpha1.ApplicationSource,
revisions []string,
sources []v1alpha1.ApplicationSource,
hasMultipleSources bool,
startedAt metav1.Time,
initiatedBy v1alpha1.OperationInitiator,
) error {
func (m *appStateManager) persistRevisionHistory(app *v1alpha1.Application, revision string, source v1alpha1.ApplicationSource, revisions []string, sources []v1alpha1.ApplicationSource, hasMultipleSources bool, startedAt metav1.Time) error {
var nextID int64
if len(app.Status.History) > 0 {
nextID = app.Status.History.LastRevisionHistory().ID + 1
Expand All @@ -902,7 +893,6 @@ func (m *appStateManager) persistRevisionHistory(
ID: nextID,
Sources: sources,
Revisions: revisions,
InitiatedBy: initiatedBy,
})
} else {
app.Status.History = append(app.Status.History, v1alpha1.RevisionHistory{
Expand All @@ -911,7 +901,6 @@ func (m *appStateManager) persistRevisionHistory(
DeployStartedAt: &startedAt,
ID: nextID,
Source: source,
InitiatedBy: initiatedBy,
})
}

Expand Down
5 changes: 2 additions & 3 deletions controller/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
argoappv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
"github.com/argoproj/argo-cd/v2/test"
Expand Down Expand Up @@ -839,7 +838,7 @@ func Test_appStateManager_persistRevisionHistory(t *testing.T) {
app.Spec.RevisionHistoryLimit = &i
}
addHistory := func() {
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1.Time{}, v1alpha1.OperationInitiator{})
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1.Time{})
assert.NoError(t, err)
}
addHistory()
Expand Down Expand Up @@ -875,7 +874,7 @@ func Test_appStateManager_persistRevisionHistory(t *testing.T) {
assert.Len(t, app.Status.History, 9)

metav1NowTime := metav1.NewTime(time.Now())
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1NowTime, v1alpha1.OperationInitiator{})
err := manager.persistRevisionHistory(app, "my-revision", argoappv1.ApplicationSource{}, []string{}, []argoappv1.ApplicationSource{}, false, metav1NowTime)
assert.NoError(t, err)
assert.Equal(t, app.Status.History.LastRevisionHistory().DeployStartedAt, &metav1NowTime)
}
Expand Down
2 changes: 1 addition & 1 deletion controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
logEntry.WithField("duration", time.Since(start)).Info("sync/terminate complete")

if !syncOp.DryRun && len(syncOp.Resources) == 0 && state.Phase.Successful() {
err := m.persistRevisionHistory(app, compareResult.syncStatus.Revision, source, compareResult.syncStatus.Revisions, compareResult.syncStatus.ComparedTo.Sources, app.Spec.HasMultipleSources(), state.StartedAt, state.Operation.InitiatedBy)
err := m.persistRevisionHistory(app, compareResult.syncStatus.Revision, source, compareResult.syncStatus.Revisions, compareResult.syncStatus.ComparedTo.Sources, app.Spec.HasMultipleSources(), state.StartedAt)
if err != nil {
state.Phase = common.OperationError
state.Message = fmt.Sprintf("failed to record sync to history: %v", err)
Expand Down
5 changes: 0 additions & 5 deletions docs/operator-manual/upgrading/2.10-2.11.md

This file was deleted.

13 changes: 0 additions & 13 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,19 +1726,6 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
13 changes: 0 additions & 13 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1725,19 +1725,6 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
13 changes: 0 additions & 13 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,19 +1726,6 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
13 changes: 0 additions & 13 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,19 +1726,6 @@ spec:
description: ID is an auto incrementing identifier of the RevisionHistory
format: int64
type: integer
initiatedBy:
description: InitiatedBy contains information about who initiated
the operations
properties:
automated:
description: Automated is set to true if operation was initiated
automatically by the application controller.
type: boolean
username:
description: Username contains the name of a user who started
operation
type: string
type: object
revision:
description: Revision holds the revision the sync was performed
against
Expand Down
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ nav:
- operator-manual/server-commands/additional-configuration-method.md
- Upgrading:
- operator-manual/upgrading/overview.md
- operator-manual/upgrading/2.10-2.11.md
- operator-manual/upgrading/2.9-2.10.md
- operator-manual/upgrading/2.8-2.9.md
- operator-manual/upgrading/2.7-2.8.md
Expand Down
3 changes: 0 additions & 3 deletions pkg/apis/application/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions pkg/apis/application/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pkg/apis/application/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1401,8 +1401,6 @@ type RevisionHistory struct {
Sources ApplicationSources `json:"sources,omitempty" protobuf:"bytes,8,opt,name=sources"`
// Revisions holds the revision of each source in sources field the sync was performed against
Revisions []string `json:"revisions,omitempty" protobuf:"bytes,9,opt,name=revisions"`
// InitiatedBy contains information about who initiated the operations
InitiatedBy OperationInitiator `json:"initiatedBy,omitempty" protobuf:"bytes,10,opt,name=initiatedBy"`
}

// ApplicationWatchEvent contains information about application change.
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/application/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {DataLoader, DropDownMenu, Duration} from 'argo-ui';
import {InitiatedBy} from './initiated-by';
import * as moment from 'moment';
import * as React from 'react';
import {Revision, Timestamp} from '../../../shared/components';
Expand Down Expand Up @@ -43,12 +42,6 @@ export const ApplicationDeploymentHistory = ({
<br />
{(info.deployStartedAt && <Duration durationMs={moment(info.deployedAt).diff(moment(info.deployStartedAt)) / 1000} />) || 'Unknown'}
</div>
<div>
<br />
Initiated by:
<br />
<InitiatedBy username={info.initiatedBy.username} automated={info.initiatedBy.automated} />
</div>
<div>
<br />
Active for:
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion ui/src/app/shared/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ export interface RevisionHistory {
sources: ApplicationSource[];
deployStartedAt: models.Time;
deployedAt: models.Time;
initiatedBy: OperationInitiator;
}

export type SyncStatusCode = 'Unknown' | 'Synced' | 'OutOfSync';
Expand Down

0 comments on commit d8dc8e2

Please sign in to comment.