Skip to content

Overlord: Support POP v9 and its finishRockHeaderUpdating command#19

Open
eduard-bagdasaryan wants to merge 7 commits intomasterfrom
SQUID-894-mgr-jobs
Open

Overlord: Support POP v9 and its finishRockHeaderUpdating command#19
eduard-bagdasaryan wants to merge 7 commits intomasterfrom
SQUID-894-mgr-jobs

Conversation

@eduard-bagdasaryan
Copy link
Contributor

No description provided.

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.


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