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

lightning: ensure the web interface still works outside server mode #259

Merged

Conversation

kennytm
Copy link
Collaborator

@kennytm kennytm commented Jan 15, 2020

What problem does this PR solve?

Fix #231.

What is changed and how it works?

Implement GET /tasks, GET /tasks/$id and DELETE /tasks/$id even when the config list is nil.

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
    • run Lightning without server mode and access the web interface.

Side effects

Related changes

  • Need to be included in the release note

@kennytm kennytm added status/PTAL This PR is ready for review. Add this label back after committing new changes priority/normal type/bug-fix Bug fix labels Jan 15, 2020
@kennytm
Copy link
Collaborator Author

kennytm commented Jan 15, 2020

/run-all-tests

@kennytm
Copy link
Collaborator Author

kennytm commented Jan 16, 2020

PTAL @july2993 @amyangfei

@lance6716
Copy link
Contributor

lance6716 commented Jan 22, 2020

Implement GET /tasks, GET /tasks/$id and DELETE /tasks/$id even when the config list is nil.

"when the config list is nil" happens only in non-server mode? That's not as apparent as "non-server mode"

Rest LGTM

@kennytm
Copy link
Collaborator Author

kennytm commented Jan 22, 2020

@lance6716 yeah this is explained in

if l.taskCfgs == nil {
// l.taskCfgs is non-nil only if Lightning is started with RunServer().
// Without the server mode this pointer is default to be nil.
writeJSONError(w, http.StatusNotImplemented, "server-mode not enabled", nil)
return
}

In non-server mode, each execution only run one task, so there is no need to initialize the config list. This was used to deduce the error message.

@kennytm kennytm added status/LGT1 One reviewer already commented LGTM (LGTM1) and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Feb 4, 2020
@kennytm
Copy link
Collaborator Author

kennytm commented Feb 4, 2020

/run-all-tests

Copy link
Collaborator

@IANTHEREAL IANTHEREAL left a comment

Choose a reason for hiding this comment

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

LGTM

@IANTHEREAL IANTHEREAL added status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) and removed status/LGT1 One reviewer already commented LGTM (LGTM1) labels Feb 5, 2020
@IANTHEREAL IANTHEREAL merged commit bab3bc1 into master Feb 5, 2020
@IANTHEREAL IANTHEREAL deleted the kennytm/still-allow-web-interface-outside-server-mode branch February 5, 2020 06:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Progress webpage fails to load in non-server mode
3 participants