Skip to content

Refactor the Service following #2447#2500

Closed
mattmoor wants to merge 1 commit intoknative:masterfrom
mattmoor:refactor-service-test
Closed

Refactor the Service following #2447#2500
mattmoor wants to merge 1 commit intoknative:masterfrom
mattmoor:refactor-service-test

Conversation

@mattmoor
Copy link
Copy Markdown
Member

This starts to factor out functional options for setting up our table tests, which reduces the verbosity a fair amount.

I've broken off Service from a broader set of changes in #2447 to make things a bit more manageable to review.

WIP until #2493 lands

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 15, 2018
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2018
Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@mattmoor: 11 warnings.

Details

In response to this:

This starts to factor out functional options for setting up our table tests, which reduces the verbosity a fair amount.

I've broken off Service from a broader set of changes in #2447 to make things a bit more manageable to review.

WIP until #2493 lands

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

}
)

func WithRunLatestRollout(s *v1alpha1.Service) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithRunLatestRollout should have comment or be unexported. More info.

}
}

func WithFailedConfig(name, reason, message string) ServiceOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithFailedConfig should have comment or be unexported. More info.

}
}

func WithPinnedRollout(name string) ServiceOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithPinnedRollout should have comment or be unexported. More info.

}
}

func WithReadyConfig(name string) ServiceOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithReadyConfig should have comment or be unexported. More info.

})
}

func WithFailedRoute(reason, message string) ServiceOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithFailedRoute should have comment or be unexported. More info.

}
}

func WithManualRollout(s *v1alpha1.Service) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithManualRollout should have comment or be unexported. More info.

s.Status.SetManualStatus()
}

func WithReadyRoute(s *v1alpha1.Service) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithReadyRoute should have comment or be unexported. More info.

}
}

// TODO(mattmoor): Ideally this could be a more generic Option and use meta.Accessor,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported function WithCreationTimestamp should be of the form "WithCreationTimestamp ...". More info.

}
}

func WithInitSvcConditions(s *v1alpha1.Service) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithInitSvcConditions should have comment or be unexported. More info.

s.Status.InitializeConditions()
}

func WithManualStatus(s *v1alpha1.Service) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function WithManualStatus should have comment or be unexported. More info.

@mattmoor mattmoor force-pushed the refactor-service-test branch from 4b3caf6 to 29f6b1d Compare November 15, 2018 04:10
@mattmoor
Copy link
Copy Markdown
Member Author

/lint

Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@mattmoor: 1 unresolved warnings and 1 new warnings.

Details

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

}
}

// WithFailedCondif reflects the Configuration's failure in the Service
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported function WithFailedConfig should be of the form "WithFailedConfig ...". More info.

@mattmoor mattmoor force-pushed the refactor-service-test branch from 29f6b1d to 5a61135 Compare November 15, 2018 04:22
@mattmoor
Copy link
Copy Markdown
Member Author

/lint

Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@mattmoor: 1 unresolved warning and 0 new warning.

Details

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

This starts to factor out functional options for setting up our table tests, which reduces the verbosity a fair amount.

I've broken off Service from a broader set of changes in knative#2447 to make things a bit more manageable to review.
@mattmoor mattmoor force-pushed the refactor-service-test branch from 5a61135 to 4139e4b Compare November 16, 2018 02:19
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 16, 2018
@mattmoor mattmoor changed the title [WIP] Refactor the Service following #2447 Refactor the Service following #2447 Nov 16, 2018
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2018
@mattmoor
Copy link
Copy Markdown
Member Author

/lint

Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@mattmoor: 0 warnings.

Details

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Object: svc("all-ready", "foo", WithRunLatestRollout,
// When the Route and Configuration come back with ready
// our initial conditions transition to Ready=True.
// TODO(mattmoor): Add Latest{Created,REady}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Ready

@mattmoor mattmoor closed this Nov 16, 2018
@mattmoor
Copy link
Copy Markdown
Member Author

This was merged via the change stacked on top of it.

@mattmoor mattmoor deleted the refactor-service-test branch November 16, 2018 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants