Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Move subscription management to new subscription subcommand #775

Closed
wants to merge 4 commits into from

Conversation

fbiville
Copy link
Contributor

Fixes #771.

@fbiville
Copy link
Contributor Author

We may not need to split into that many commits.
Maybe I should create a first PR for the first commit and a second one with the rest.
Once the first PR is merged, I can easily migrate FATS to the new command without breaking anything.

@fbiville
Copy link
Contributor Author

Also, shall we wait for knative/eventing#421 to be merged before merging this?

Copy link
Contributor

@glyn glyn left a comment

Choose a reason for hiding this comment

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

Some minor comments and some flag renaming which came out of the sync call on 18th September.


err := createCommand.Execute()

Expect(err.Error()).To(HavePrefix("a DNS-1123 subdomain must consist"))
Copy link
Contributor

@glyn glyn Sep 18, 2018

Choose a reason for hiding this comment

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

The approach taken elsewhere is:

Expect(err).To(MatchError(HavePrefix("...")))

func defineFlags(command *Command, options *core.CreateSubscriptionOptions) {
flags := command.Flags()
flags.StringVarP(&options.Subscriber, "processor", "s", "", "the subscriber registered in the subscription")
flags.StringVarP(&options.Channel, "from", "i", "", "the input channel the service binds to")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the consensus in the team is to change this flag to --channel with abbreviation -c.

flags := command.Flags()
flags.StringVarP(&options.Subscriber, "processor", "s", "", "the subscriber registered in the subscription")
flags.StringVarP(&options.Channel, "from", "i", "", "the input channel the service binds to")
flags.StringVarP(&options.ReplyTo, "to", "o", "", "the optional output channel the service binds to")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the consensus in the team is to change this flag to --reply-to with abbreviation -r.


func defineFlags(command *Command, options *core.CreateSubscriptionOptions) {
flags := command.Flags()
flags.StringVarP(&options.Subscriber, "processor", "s", "", "the subscriber registered in the subscription")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the consensus in the team is to change this flag to --subscriber with abbreviation -s.

Expect(stdout.String()).To(Equal("create completed successfully\n"))
})

It("should create the subscription in the output provided namespace", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this say "... in the provided namespace"?

Channel: "coco-chanel",
}).Return(nil, nil)

err := createCommand.Execute()
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that some other tests put the equivalent of this line of code in a JustBeforeEach rather than repeating it in each test. Take a look at this example and see what you think. This is just a suggestion for a change as these tests are pretty readable as they stand.

Expect(stdout.String()).To(Equal("create completed successfully\n"))
})

It("should propagate the client error", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this say "should propagate a client error" as there won't necessarily be an error.

@glyn
Copy link
Contributor

glyn commented Sep 18, 2018

Applied the requested changes and merged as 515f26a

@glyn glyn closed this Sep 18, 2018
@fbiville fbiville deleted the issue_771 branch September 19, 2018 08:16
@fbiville
Copy link
Contributor Author

Thanks a lot @glyn!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants