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 IPv6 support #37

Merged
merged 5 commits into from
May 31, 2024
Merged

Add IPv6 support #37

merged 5 commits into from
May 31, 2024

Conversation

paramite
Copy link
Member

This patch makes bridge accept IPv6 addresses as amqp_url value.

@vkmc vkmc self-requested a review May 28, 2024 15:23
Copy link
Contributor

@csibbitt csibbitt left a comment

Choose a reason for hiding this comment

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

This LGTM but I'd like to know it's tested before we merge.

bridge.h Outdated Show resolved Hide resolved
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/7de835f5d677447f8e8cda8be0809828

stf-crc-ocp_412-local_build FAILURE in 21m 52s
stf-crc-ocp_414-local_build FAILURE in 1h 01m 02s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 1h 05m 41s
stf-crc-ocp_414-local_build-index_deploy FAILURE in 1h 02m 04s

@vkmc
Copy link
Contributor

vkmc commented May 29, 2024

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/d0ae14586cbd4b9fa39988bf0722d9a0

stf-crc-ocp_412-local_build RETRY_LIMIT in 19m 09s
stf-crc-ocp_414-local_build FAILURE in 57m 31s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 22m 40s
stf-crc-ocp_414-local_build-index_deploy FAILURE in 1h 02m 15s

@vkmc
Copy link
Contributor

vkmc commented May 29, 2024

There is some recurring failure in the CI, not related to the timeouts. It seems that the bridge container is constantly failing. See for example https://review.rdoproject.org/zuul/build/e7227852b3a747bf857a1168dddc1c71/log/controller/controller/post_oc_describe_pod_default-cloud1-ceil-event-smartgateway-7b5d4fcd79-5fswr.log in the stf-crc-ocp_414-local_build. We don't really have access to the container logs IIRC.

Copy link
Contributor

@vkmc vkmc left a comment

Choose a reason for hiding this comment

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

Seems there is something wrong when trying to start the smart-gateway with this change.

@paramite paramite force-pushed the ipv6 branch 3 times, most recently from 6084660 to 07f0cf2 Compare May 29, 2024 15:11
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/f436f1100762481ab5ca65482b6fbca2

stf-crc-ocp_412-local_build FAILURE in 21m 11s
stf-crc-ocp_414-local_build FAILURE in 58m 10s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 20m 31s
stf-crc-ocp_414-local_build-index_deploy FAILURE in 1h 00m 55s

@paramite paramite force-pushed the ipv6 branch 12 times, most recently from cef5bff to 3faee27 Compare May 29, 2024 18:50
This patch makes bridge accept IPv6 addresses as amqp_url value.
tests.c Show resolved Hide resolved
@vyzigold
Copy link
Contributor

The ending of the new regex is the cause of the CI failures. It seems the "[^\\s]" doesn't work as intended instead of matching "non-whitespace" it seems to match "non-'s' character". And because we use "s" in the address in the CI, it fails. Otherwise an impressive work. Thank you.

@csibbitt
Copy link
Contributor

csibbitt commented May 29, 2024

The ending of the new regex is the cause of the CI failures. It seems the "[^\\s]" doesn't work as intended instead of matching "non-whitespace" it seems to match "non-'s' character". And because we use "s" in the address in the CI, it fails. Otherwise an impressive work. Thank you.

I reproduced this locally, if I change /baz to /bas in a unit test I get a segfault instead of a pass. :)

I've pushed a commit that fixes this and leaves the /bas version there to prove it.

bridge.h Outdated
Comment on lines 30 to 31
"(([a-z]+)(:([a-z]+))*@)*([a-zA-Z_0-9.-]+|\\[[:a-fA-F0-9]+\\])(:([0-9]+))" \
"?(/[^\\s]*)?$"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"(([a-z]+)(:([a-z]+))*@)*([a-zA-Z_0-9.-]+|\\[[:a-fA-F0-9]+\\])(:([0-9]+))" \
"?(/[^\\s]*)?$"
"(([a-z]+)(:([a-z]+))*@)*([a-zA-Z_0-9.-]+|\\[[:a-fA-F0-9]+\\])(:([0-9]+))?"\
"(/[^\\s]*)?$"

Does this violate the linter? It took me a bit longer to parse this with the ? on the second line

Copy link
Contributor

Choose a reason for hiding this comment

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

Here the port # is optional, but there are no unit tests that leave out the port #. FWIW I edited the port and the check for it out of a random test and it worked.

@@ -275,16 +236,21 @@ int main(int argc, char **argv) {

match_regex(AMQP_URL_REGEX, matches, 10, app.amqp_con.url);
if (matches[3] != NULL) {
app.amqp_con.user = strdup(matches[2]);
app.amqp_con.user = strdup(matches[3]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Good find! This is an old bug that we should have caught in the initial review years ago.

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/0468b5339a1e407786344751d64f5b11

stf-crc-ocp_412-local_build FAILURE in 23m 51s
stf-crc-ocp_414-local_build FAILURE in 59m 16s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 1h 00m 43s
stf-crc-ocp_414-local_build-index_deploy FAILURE in 1h 06m 12s

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/1863dc58ead042f39b78644968a3275f

stf-crc-ocp_412-local_build FAILURE in 55m 35s
stf-crc-ocp_414-local_build FAILURE in 59m 12s
stf-crc-ocp_412-local_build-index_deploy RETRY_LIMIT in 20m 38s
stf-crc-ocp_414-local_build-index_deploy TIMED_OUT in 1h 07m 48s

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/5ad98ea6ecc64ee6a0ec29ef18f6ff2a

✔️ stf-crc-ocp_412-local_build SUCCESS in 38m 10s
✔️ stf-crc-ocp_414-local_build SUCCESS in 39m 59s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 20m 20s
✔️ stf-crc-ocp_414-local_build-index_deploy SUCCESS in 47m 30s

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/b51d7a850e3c40f28bf8e1afed8106c6

stf-crc-ocp_412-local_build RETRY_LIMIT in 20m 15s
stf-crc-ocp_414-local_build FAILURE in 47m 12s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 23m 32s
✔️ stf-crc-ocp_414-local_build-index_deploy SUCCESS in 49m 47s

@paramite
Copy link
Member Author

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/839a8cda38ba496786d5c41b4d97f9ee

stf-crc-ocp_412-local_build FAILURE in 23m 48s
✔️ stf-crc-ocp_414-local_build SUCCESS in 45m 01s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 20m 56s
✔️ stf-crc-ocp_414-local_build-index_deploy SUCCESS in 51m 04s

@paramite
Copy link
Member Author

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/be9f9f5d5f704012a2508d658596583c

stf-crc-ocp_412-local_build FAILURE in 20m 34s
✔️ stf-crc-ocp_414-local_build SUCCESS in 40m 53s
stf-crc-ocp_412-local_build-index_deploy RETRY_LIMIT in 19m 53s
stf-crc-ocp_414-local_build-index_deploy RETRY_LIMIT in 7s

@vkmc
Copy link
Contributor

vkmc commented May 31, 2024

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/4083e97099934b15a550a988499978da

stf-crc-ocp_412-local_build FAILURE in 22m 18s
✔️ stf-crc-ocp_414-local_build SUCCESS in 43m 07s
stf-crc-ocp_412-local_build-index_deploy FAILURE in 22m 40s
✔️ stf-crc-ocp_414-local_build-index_deploy SUCCESS in 44m 41s

@vkmc vkmc self-requested a review May 31, 2024 08:59
Copy link
Contributor

@vkmc vkmc left a comment

Choose a reason for hiding this comment

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

Code looks good, and thanks so much for enhancing test coverage and automation as well!

@vkmc vkmc merged commit bf54f32 into infrawatch:master May 31, 2024
1 of 2 checks passed
vkmc added a commit that referenced this pull request Aug 26, 2024
* [zuul] Add zuul jobs to sg-bridge (#33)

Depends-On: http://github.com/infrawatch/service-telemetry-operator/pull/512

* [zuul] Use the stf-crc-jobs project template (#34)

Instead of updating the .zuul.yaml file everytime
infrawatch/service-telemetry-operator adds a new job, the
project-template can be updated in STO, which will propogate
the change to the project and avoid leaving gaps in testing.

Depends-On: infrawatch/service-telemetry-operator#514

* Bump actions checkout to v4 (#36)

Bump actions checkout to v4 since Node.js 16 actions are deprecated.
We need to update to Node.js 20, which is included in actions/checkout@v4.

* Rebuild obj files on %.h changes (#38)

* Add IPv6 support (#37)

* Add IPv6 support

This patch makes bridge accept IPv6 addresses as amqp_url value.

* Committing clang-format changes

* Eliminate implicit-function-declaration in tests

* Correct character class in AMQP_URL_REGEX

---------

Co-authored-by: InfraWatch CI <[email protected]>
Co-authored-by: Chris Sibbitt <[email protected]>
Co-authored-by: Victoria Martinez de la Cruz <[email protected]>

* Update repo info for opstools (#39)

Centos8s went EOL on 31.05.2024 so the packages have been moved to
centos vault mirror the repo config we use needs to be updated

---------

Co-authored-by: Emma Foley <[email protected]>
Co-authored-by: Jaromír Wysoglad <[email protected]>
Co-authored-by: Martin Mágr <[email protected]>
Co-authored-by: InfraWatch CI <[email protected]>
Co-authored-by: Chris Sibbitt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants