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

Overlord: Support POP v9 and its finishRockHeaderUpdating command #19

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

eduard-bagdasaryan
Copy link
Contributor

No description provided.

src/overlord/Proxy.js Outdated Show resolved Hide resolved
src/overlord/Proxy.js Outdated Show resolved Hide resolved
Copy link
Contributor Author

@eduard-bagdasaryan eduard-bagdasaryan left a comment

Choose a reason for hiding this comment

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

Done at 8572e01.

src/overlord/Proxy.js Outdated Show resolved Hide resolved
src/overlord/Proxy.js Outdated Show resolved Hide resolved
@@ -438,6 +438,14 @@ export class ProxyOverlord {
console.log("Proxy finished any pending caching transactions");
}

async finishRockHeaderUpdating() {
const options = {
'Overlord-job.type': '\\bRock::HeaderUpdater',
Copy link
Contributor

Choose a reason for hiding this comment

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

Alex: I hope \b part of the regex will be relayed correctly,

Eduard: This causes a typeError:

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Overlord-job.type"]
    at ClientRequest.setHeader (_http_outgoing.js:488:3)
    at new ClientRequest (_http_client.js:221:14)
    at Proxy.request (http.js:44:10)
    at Proxy.js:552:34

Let's try to add reliable support for passing regexes to DUT overlord:

  1. Rename Overlord-job.type option to Overlord-job-type-regex

  2. Adjust ProxyOverlord::_remoteCall() to handle options with names ending with -regex specially:

  • Validate that the passed value is a regex from Javascript point of view. If we can demand RegExp objects as values, we should!
  • Encode values using the simplest standard HTTP-safe and, ideally, human-reader-friendly encoding you can find; we must preserve things like backslashes, commas, and spaces (all are HTTP-unsafe). The encoding should be "natively" supported by Javascript and Perl -- we do not want to add packages/dependencies OR implement decoders/encoders.
  1. Adjust the Perl script in a similar fashion:
  • decode -regex values
  • validate that each decoded value is a regex from Perl point of view

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done (up to 13bf63d).

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