Skip to content

Support railway init projectid#15

Merged
JakeCooper merged 2 commits intomasterfrom
j/rail-383-support-railway-init-projectid
Oct 7, 2020
Merged

Support railway init projectid#15
JakeCooper merged 2 commits intomasterfrom
j/rail-383-support-railway-init-projectid

Conversation

@coffee-cup
Copy link
Copy Markdown
Contributor

  • Support railway init
  • Prompt for environment if there is more than 1 in a project
  • Show "Project not found" error instead of "graphql: Not authorised" if fetching a project fails

@linear
Copy link
Copy Markdown

linear Bot commented Oct 5, 2020

Comment thread cmd/init.go

err = h.saveProjectAndEnvironment(ctx, project)
if err != nil {
return nil
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.

Nice fix lol

Comment thread cmd/init.go
if len(req.Args) > 0 {
// projectID provided as argument
projectID := req.Args[0]
return h.saveProjectWithID(ctx, projectID)
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.

Can we keep these to following the common interface of taking a context + a CommandRequest?

projectId should be retrievable from req.Args[0]

Comment thread gateway/project.go
}
if err := g.gqlClient.Run(ctx, gqlReq, &resp); err != nil {
return nil, err
return nil, errors.ProjectNotFound
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.

Any reason we're masking the error from users?

Additionally, it would be really good to have error reporting in the CLI

@JakeCooper JakeCooper merged commit 4129b8a into master Oct 7, 2020
@JakeCooper JakeCooper deleted the j/rail-383-support-railway-init-projectid branch October 7, 2020 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants