Skip to content
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

Add ability to upload+reload routes.yaml #9744

Closed
5 tasks done
kirrg001 opened this issue Jul 20, 2018 · 4 comments
Closed
5 tasks done

Add ability to upload+reload routes.yaml #9744

kirrg001 opened this issue Jul 20, 2018 · 4 comments
Assignees
Labels
affects:admin Anything relating to Ghost Admin feature [triage] New features we're planning or working on server / core Issues relating to the server or core of Ghost

Comments

@kirrg001
Copy link
Contributor

kirrg001 commented Jul 20, 2018

We haven't announced Dynamic Routing Beta yet, but you can already read through this issue and read what Dynamic Routing is and how it works 🤠

We would like to add the ability to upload the routes.yaml file in the admin panel. We will add a new form under Labs (very similar to the redirects upload form).

When the file was successfully uploaded, Ghost will reload all site routes based on your new routes.yaml version/file. A server restart won't be required.

This sub-feature will be available in Ghost 2.0.

Tasks

  • reload express site app after the routes.yaml file was uploaded
  • add proper error handling e.g. what if you upload a broken routes.yaml file - use backup and return a proper message to the user
  • add simple UI @kevinansfield
  • add more tests
  • create backup (use the same strategy as for redirects)
@kirrg001 kirrg001 added server / core Issues relating to the server or core of Ghost feature [triage] New features we're planning or working on affects:admin Anything relating to Ghost Admin labels Jul 20, 2018
@ErisDS ErisDS mentioned this issue Jul 20, 2018
15 tasks
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Jul 20, 2018
@kirrg001
Copy link
Contributor Author

Endpoints:

I am following the convention of our redirect uploads.

POST /routes/yaml
GET /routes/yaml

@kirrg001
Copy link
Contributor Author

kirrg001 commented Jul 24, 2018

Alternative is

POST /settings/routes/yaml
GET /settings/routes/yaml

The routes.yaml file is currently treated as "extra" blog setting - just file based. Furthermore, the routes.yaml file is completely handled in our settings service.

Maybe it's better to stay consistent for now and use this route notation.

kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jul 24, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
@kevinansfield
Copy link
Contributor

@kirrg001 PR for the UI is here, I've also created a 2.0 branch in Ghost-Admin with this commit already merged. Code is completely untested so far because I couldn't see that the endpoints were implemented anywhere yet 😄

kirrg001 added a commit to kirrg001/Ghost that referenced this issue Jul 25, 2018
refs TryGhost#9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 pushed a commit to TryGhost/Admin that referenced this issue Jul 25, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
kirrg001 added a commit that referenced this issue Jul 31, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 3, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
@kirrg001
Copy link
Contributor Author

kirrg001 commented Aug 7, 2018

This issue can be closed. All tasks are done. Final QA/testing will happen soon.

@kirrg001 kirrg001 closed this as completed Aug 7, 2018
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Aug 7, 2018
kirrg001 added a commit that referenced this issue Aug 8, 2018
kevinansfield added a commit to TryGhost/Admin that referenced this issue Aug 8, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
kevinansfield added a commit to TryGhost/Admin that referenced this issue Aug 8, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
kevinansfield added a commit to TryGhost/Admin that referenced this issue Aug 8, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
kirrg001 added a commit that referenced this issue Aug 9, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 9, 2018
kirrg001 added a commit that referenced this issue Aug 10, 2018
kirrg001 added a commit that referenced this issue Aug 10, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 10, 2018
kirrg001 added a commit that referenced this issue Aug 10, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
kirrg001 added a commit that referenced this issue Aug 11, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 11, 2018
kirrg001 added a commit that referenced this issue Aug 11, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
kirrg001 added a commit that referenced this issue Aug 12, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 12, 2018
kirrg001 added a commit that referenced this issue Aug 12, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
kirrg001 pushed a commit to TryGhost/Admin that referenced this issue Aug 12, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
kirrg001 added a commit that referenced this issue Aug 13, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 13, 2018
kirrg001 added a commit that referenced this issue Aug 13, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
kirrg001 added a commit that referenced this issue Aug 14, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 14, 2018
kirrg001 added a commit that referenced this issue Aug 14, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
kevinansfield added a commit to TryGhost/Admin that referenced this issue Aug 14, 2018
refs TryGhost/Ghost#9744
- adds `routes.yaml` upload using the same UI as the `redirects.json` upload
  - upload: `POST /settings/routes/yaml/`
  - download: `GET /settings/routes/yaml/`
kirrg001 added a commit that referenced this issue Aug 15, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
kirrg001 added a commit that referenced this issue Aug 16, 2018
refs #9744

- added two new endpoints to upload/download routes.yaml
- reload site express app on successful/valid upload
- reload url service on sucessfuly upload
- force clear cache of pages
- ensure we keep a backup of the routes.yaml file
- this feature was mostly tested manually
- @todo: i have to write unit tests - will do later
- @todo: do a memory test to ensure we haven't introduced any memory leaks with this feature
kirrg001 added a commit that referenced this issue Aug 16, 2018
kirrg001 added a commit that referenced this issue Aug 16, 2018
refs #9601, refs #9744

- the express router reference wasn't updated fully
- the stack was the old router stack when you have uploaded a new routes.yaml file
  - this has caused e.g. that new redirects for channels/collections didn't work after the upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin feature [triage] New features we're planning or working on server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

2 participants