Skip to content

Remove deprecated field from Deployment #5809

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion pkg/app/piped/controller/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,6 @@ func (s *scheduler) reportMostRecentlySuccessfulDeployment(ctx context.Context)
DeploymentId: s.deployment.Id,
Trigger: s.deployment.Trigger,
Summary: s.deployment.Summary,
Version: s.deployment.Version,
Versions: s.deployment.Versions,
ConfigFilename: s.deployment.GitPath.GetApplicationConfigFilename(),
StartedAt: s.deployment.CreatedAt,
Expand Down
1 change: 0 additions & 1 deletion pkg/app/piped/trigger/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func reportMostRecentlyTriggeredDeployment(ctx context.Context, client apiClient
DeploymentId: d.Id,
Trigger: d.Trigger,
Summary: d.Summary,
Version: d.Version,
Versions: d.Versions,
StartedAt: d.CreatedAt,
CompletedAt: d.CompletedAt,
Expand Down
1 change: 0 additions & 1 deletion pkg/app/pipedv1/controller/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ func (s *scheduler) reportMostRecentlySuccessfulDeployment(ctx context.Context)
DeploymentId: s.deployment.Id,
Trigger: s.deployment.Trigger,
Summary: s.deployment.Summary,
Version: s.deployment.Version,
Versions: s.deployment.Versions,
ConfigFilename: s.deployment.GitPath.GetApplicationConfigFilename(),
StartedAt: s.deployment.CreatedAt,
Expand Down
1 change: 0 additions & 1 deletion pkg/app/pipedv1/trigger/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func reportMostRecentlyTriggeredDeployment(ctx context.Context, client apiClient
DeploymentId: d.Id,
Trigger: d.Trigger,
Summary: d.Summary,
Version: d.Version,
Versions: d.Versions,
StartedAt: d.CreatedAt,
CompletedAt: d.CompletedAt,
Expand Down
1 change: 0 additions & 1 deletion pkg/datastore/deploymentstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ var (
d.StatusReason = statusReason
d.RunningCommitHash = runningCommitHash
d.RunningConfigFilename = runningConfigFilename
d.Version = version
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the argument version because it is unused now.

d.Versions = versions
d.Stages = stages
return nil
Expand Down
1 change: 0 additions & 1 deletion pkg/datastore/deploymentstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func TestDeploymentToPlannedUpdater(t *testing.T) {
assert.Equal(t, expectedStatusDesc, d.StatusReason)
assert.Equal(t, expectedRunningCommitHash, d.RunningCommitHash)
assert.Equal(t, expectedRunningConfigFilename, d.RunningConfigFilename)
assert.Equal(t, expectedVersion, d.Version)
assert.Equal(t, expectedVersions, d.Versions)
assert.Equal(t, expectedStages, d.Stages)
}
Expand Down
410 changes: 200 additions & 210 deletions pkg/model/deployment.pb.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions pkg/model/deployment.pb.validate.go

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

5 changes: 2 additions & 3 deletions pkg/model/deployment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ enum StageStatus {
// - User clicked on Sync button at application web page.
// - Triggered by another deployment.
message Deployment {
reserved 4;
reserved 4,23;

// The generated unique identifier.
string id = 1 [(validate.rules).string.min_len = 1];
Expand Down Expand Up @@ -91,8 +91,7 @@ message Deployment {
// e.g. Scale from 10 to 100 replicas.
// e.g. Update image from v1.5.0 to v1.6.0.
string summary = 22;
// TODO: Remove version from deployment model.
string version = 23;

repeated ArtifactVersion versions = 24;

// Hash value of the most recently successfully deployed commit.
Expand Down
4 changes: 0 additions & 4 deletions web/model/deployment_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export class Deployment extends jspb.Message {
getSummary(): string;
setSummary(value: string): Deployment;

getVersion(): string;
setVersion(value: string): Deployment;

getVersionsList(): Array<pkg_model_common_pb.ArtifactVersion>;
setVersionsList(value: Array<pkg_model_common_pb.ArtifactVersion>): Deployment;
clearVersionsList(): Deployment;
Expand Down Expand Up @@ -122,7 +119,6 @@ export namespace Deployment {
labelsMap: Array<[string, string]>,
trigger?: DeploymentTrigger.AsObject,
summary: string,
version: string,
versionsList: Array<pkg_model_common_pb.ArtifactVersion.AsObject>,
runningCommitHash: string,
runningConfigFilename: string,
Expand Down
30 changes: 0 additions & 30 deletions web/model/deployment_pb.js

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

2 changes: 0 additions & 2 deletions web/src/__fixtures__/dummy-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const dummyDeployment: Deployment.AsObject = {
status: DeploymentStatus.DEPLOYMENT_SUCCESS,
statusReason: "good",
trigger: dummyTrigger,
version: "0.0.0",
versionsList: [],
cloudProvider: "kube-1",
platformProvider: "kube-1",
Expand Down Expand Up @@ -65,7 +64,6 @@ export function createDeploymentFromObject(o: Deployment.AsObject): Deployment {
deployment.setStatusReason(o.statusReason);
deployment.setSummary(o.summary);
deployment.setUpdatedAt(o.updatedAt);
deployment.setVersion(o.version);
o.gitPath && deployment.setGitPath(createGitPathFromObject(o.gitPath));
o.trigger && deployment.setTrigger(createTriggerFromObject(o.trigger));
o.stagesList &&
Expand Down