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

Resolve all pending problems with the current Dredd hook template #917

Open
honzajavorek opened this issue Nov 21, 2017 · 6 comments
Open

Comments

@honzajavorek
Copy link
Contributor

There are two main problems on the hook template, which exploded into far more complicated issues then they seemed to be:

  • Aruba update
  • Missing --port and --host support

Hook handler authors were trying to propose and contribute, but now it's getting complicated, stale, tangled together. I think no contributor will come and reintroduce order to things, we'll have to come and push things forward. I tried to untangle all the problems and I propose following 10 steps:

Update Aruba

  1. Kill extraneous child processes with Aruba
    Update all existing hook repos with the latest changes in this template dredd-hooks-template#16 (comment)
    The test suite kills any process (including itself) if its path contains string 'dredd-hooks' (e.g. in dir name) dredd-hooks-template#6

  2. Finish update of the template in Ruby hooks
    Update dependency: Aruba (2) dredd-hooks-ruby#31

  3. Finish update of the template in Python hooks
    Update Aruba test suite to contain the latest changes dredd-hooks-python#28

  4. Update the template itself with the changes
    Update all existing hook repos with the latest changes in this template dredd-hooks-template#16
    Update dependencies dredd-hooks-template#15

Add --port and --host

  1. Implement trial and error behavior in Dredd when running the hook
    handler
    Dumb implementation for support --port and --host for hooks server #712 (comment)

  2. Properly resolve hook handler arguments
    Dredd should pass hook files as absolute paths to a hook handler #742

  3. Pass --port and --host to the hook handler
    Dumb implementation for support --port and --host for hooks server #712

  4. Add test for --port and --host to the template
    Add test for configurable port dredd-hooks-template#17

Propagate changes

  1. Propagate changes to all hook handlers
    Update all existing hook repos with the latest changes in this template dredd-hooks-template#16

  2. Document the process for adding things to the template
    Document a process for updating this repo & propagating changes to all hook handlers dredd-hooks-template#19

@ddelnano
Copy link
Contributor

😓 really dropped the ball on coming back to #712

@honzajavorek
Copy link
Contributor Author

honzajavorek commented Apr 11, 2019

Current strategy, which includes apiaryio/dredd-hooks-template#23 as well:

@honzajavorek
Copy link
Contributor Author

@ddelnano I'm about to get back to #712 (comment) and I'm wondering... would following work as well?

  • Dredd runs the hooks handler only with paths to hook files if port and host are set to the default values
  • If port or host are set to non-default values, then --port, --host, or both are added as options to the hooks handler command
  • In case the hooks handler crashes, Dredd will terminate, but will remember that port or host change was involved and will warn user with something like "hey, perhaps the hooks handler you're using doesn't support host / port change, so don't do that..."
  • In case the hooks handler doesn't crash, but Dredd isn't able to connect, it will terminate, but will remember that port or host change was involved and will warn user with something like "hey, perhaps the hooks handler you're using doesn't support host / port change, so don't do that..."
  • Otherwise business as usual

What do you think?

@ddelnano
Copy link
Contributor

ddelnano commented Jul 9, 2019

Sorry I was in the middle of moving and then went on vacation 🍹. That sounds like the best plan for rolling out this change.

@honzajavorek
Copy link
Contributor Author

I did most of the dirty work needed here and there's a work in progress in #1421 to implement the actual --port forwarding in Dredd.

@lukaszwit
Copy link

Hi, I would like to ask if the work is going to be continued on this issue?

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

No branches or pull requests

3 participants