WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Didericis
Copy link
Contributor

@Didericis Didericis commented Dec 3, 2025

Depends on this pear-link pr

rafapaezbas and others added 3 commits November 27, 2025 15:41
* Bump deps (#950)

Co-authored-by: GitHub Actions Bot <[email protected]>

* 2.2.4 changelog

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions Bot <[email protected]>
Co-authored-by: rafapaezbas <[email protected]>
Co-authored-by: rafapaezbas <[email protected]>
* Bump deps (#954)

Co-authored-by: GitHub Actions Bot <[email protected]>

* 2.2.6 changelog

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions Bot <[email protected]>
Co-authored-by: rafapaezbas <[email protected]>
@Didericis Didericis changed the title Prevent malformed links in opstream from crashing sidecare Prevent malformed links in opstream from crashing sidecar Dec 3, 2025
@Didericis Didericis force-pushed the test/fix-malformed-args-error branch 8 times, most recently from 2029981 to 5b99fac Compare December 4, 2025 13:50
@Didericis Didericis changed the title Prevent malformed links in opstream from crashing sidecar Prevent bad link in opstream from crashing sidecar Dec 4, 2025
@Didericis Didericis force-pushed the test/fix-malformed-args-error branch 3 times, most recently from 4f8af77 to 58dce4f Compare December 4, 2025 14:15
@Didericis Didericis marked this pull request as ready for review December 4, 2025 14:25
const Helper = require('./helper')

test('running ops with invalid link param does not crash the sidecar', async (t) => {
const opMethods = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally this would be pointing to a shared location so when ops get added they get tested by this.

I tried moving the code here into subsystems/sidecar/ops/index.js and then referencing that in this test, but that caused tests to be flakey/introduced a timing error.

Decided to just keep this a simple list despite the brittleness (as long as at least one op is tested via this the test is still valuable).

Copy link
Contributor

Choose a reason for hiding this comment

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

nice. does it also pass if I dont pass an obj? eg: stage('str') , info(int) ....

Copy link
Contributor

Choose a reason for hiding this comment

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

check if all cases are covered bc there is a conditional here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice. does it also pass if I dont pass an obj? eg: stage('str') , info(int) ....

Will test those cases as well, but yeah, works as expected/fails if it's invalid. Will add more coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@geordangesink added some more cases, but RE that line specifically, one thing to note is that the normalize function doesn't actually decode the link or do the full link validation.

I thought about doing full link validation when the param is present, but think it's best to have that handled in specific ops where the link is used. It looks like some ops like gc don't actually use the link param, so parsing a param that gets discarded would be wasteful. But all the major types that could be passed are explicitly covered now.

@Didericis Didericis force-pushed the test/fix-malformed-args-error branch 4 times, most recently from 25dcf87 to d271814 Compare December 4, 2025 17:04
@Didericis Didericis force-pushed the test/fix-malformed-args-error branch from d271814 to 1c10226 Compare December 4, 2025 19:11
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.

4 participants