Attention is currently required from: msuraev.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28992 )
Change subject: Add osmo_sockaddr_strs_to_str()
......................................................................
Patch Set 8:
(9 comments)
Patchset:
PS8:
I'm sorry that I'm late for this patch review.
This patch has a number of rough edges,
I would welcome if we could revert it and get some more review cycles.
File src/sockaddr_str.c:
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/6219adc6_145bfcb8
PS8, Line 547: * buf_len >= 2: (hostA|hostB|...|...)
buf_len is the buffer size of the output string buffer *buf.
A buf_len == 0 cannot return any "()" string, it has zero size.
buf_len == 1 cannot contain "hostA".
Did you mean sa_str_count?
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/d27293a9_acbb2b9e
PS8, Line 555: int osmo_sockaddr_strs_to_str(char *buf, size_t buf_len, const struct osmo_sockaddr_str **sa_str, size_t sa_str_count)
i find it odd that you want to pass an array of osmo_sockaddr_str POINTERS,
instead of an array of osmo_sockaddr_str instances.
i.e. i would expect an arg like 'const struct osmo_sockaddr_str *sa_strs',
not '**'.
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/316d840f_674d4fd8
PS8, Line 562: return -ENOMEM;
this check should not be here. The idea is to always return the nr of characters needed to output the full string, regardless of the underlying buffer length. If you return -ENOMEM on some specific buffer lengths, you destroy the ability of finding a sufficient buffer length from the return value. The OSMO_STRBUF macros deal with all cases of insufficient buffer length, just let it play through to the end, so that the proper sb.chars_needed is returned.
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/fdcd0fdd_b3bde8dc
PS8, Line 567: for (i = 0; i < sa_str_count; i++) {
for (...) {
if (i)
OSMO_STRBUF_PRINTF(sb, "|");
if (sa_str[i])
OSMO_STRBUF_PRINTF(sb, OSMO_SOCKADDR_STR_NO_PORT_FMT,
OSMO_SOCKADDR_STR_NO_PORT_FMT_ARGS(sa_str[i]));
}
if (sa_str_count != 1)
OSMO_STRBUF_PRINTF(sb, ")");
File tests/sockaddr_str/sockaddr_str_test.c:
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/078d4d8b_e4da2349
PS8, Line 28: #include <osmocom/core/logging.h>
why add application and logging?
there should be no select loop.
nothing about osmo_sockaddr_str should ever cause osmocom logging.
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/a57e7473_891bec86
PS8, Line 268: struct osmo_sockaddr_str *sa_strs[OSMO_SOCK_MAX_ADDRS];
(...and here just a struct osmo_sockaddr_str sa_strs[N], no need to talloc instances below)
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/998f5771_bdf3e063
PS8, Line 271: for (i = 0, j = 0; j < count && i < OSMO_SOCK_MAX_ADDRS; j++) {//ARRAY_SIZE(oip_data)
can we drop the // comments?
https://gerrit.osmocom.org/c/libosmocore/+/28992/comment/146c54fa_9c1e2c65
PS8, Line 290: };
why add logging infrastructure??
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28992
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic0d7c08f669994e37a2314555ecac85d28c42c89
Gerrit-Change-Number: 28992
Gerrit-PatchSet: 8
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Aug 2022 00:34:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ci/+/29110
to look at the new patch set (#2).
Change subject: readme, and sanitize feed name
......................................................................
readme, and sanitize feed name
In a README, explain how to use these scripts to test a private branch.
The README suggests using a private branch as feed. I am not sure
whether a forward slash is allowed in a feed name, but I know that the
feed name is put in a sed 's/../../' command, hence sanitize feed name.
Change-Id: I4d1303e0c04e827200b48a9fe4aea3680c9c9f84
---
A scripts/obs/README
M scripts/obs/lib/config.py
M scripts/obs/lib/srcpkg.py
3 files changed, 122 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/10/29110/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29110
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I4d1303e0c04e827200b48a9fe4aea3680c9c9f84
Gerrit-Change-Number: 29110
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29110 )
Change subject: readme, and sanitize feed name
......................................................................
readme, and sanitize feed name
In a README, explain how to use these scripts to test a private branch.
The README suggests using a private branch as feed. I am not sure
whether a forward slash is allowed in a feed name, but I know that the
feed name is put in a sed 's/../../' command, hence sanitize feed name.
Change-Id: I4d1303e0c04e827200b48a9fe4aea3680c9c9f84
---
A scripts/obs/README
M scripts/obs/lib/config.py
M scripts/obs/lib/srcpkg.py
3 files changed, 121 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/10/29110/1
diff --git a/scripts/obs/README b/scripts/obs/README
new file mode 100644
index 0000000..995344a
--- /dev/null
+++ b/scripts/obs/README
@@ -0,0 +1,115 @@
+Submitting source packages to Osmocom's OBS build server
+========================================================
+
+Dependencies:
+
+ apt-get install dh-python meson osc rebar3
+
+Usage Example
+=============
+
+I want to test changes to the packaging of osmo-hnbgw.
+They are committed on a private branch osmo-hnbgw.git:neels/gtpmap.
+I want to test this in my OBS "Home Project" called home:nhofmeyr:test.
+
+Here are the steps of what I do:
+
+OBS home project
+----------------
+
+Sign up / sign in to obs.osmocom.org and create the "test" project under the
+"Home Project" link (right next to the "Logout" link on the OBS web interface),
+so that https://obs.osmocom.org/project/show/home:nhofmeyr:test exists.
+
+Make sure I can list the project using the 'osc' tool.
+That requires an osc config file.
+Easiest is to let osc create one and then edit it:
+
+ $ osc list home:nhofmeyr:test
+ Username: nhofmeyr
+ Password: ************
+ Select credentials manager: 4
+ Server returned an error: HTTP Error 401: Unauthorized
+
+Now edit ~/.config/osc/oscrc and set the API URL to obs.osmocom.org:
+Replace "api.opensuse.org" with "obs.osmocom.org" in two places:
+
+ sed -i 's/api\.opensuse\.org/obs.osmocom.org/' ~/.config/osc/oscrc
+
+Now the 'osc list' command should no longer fail:
+
+ $ osc list home:nhofmeyr:test
+ libosmo-pfcp
+
+Publish patches in private branch
+---------------------------------
+
+Push my private branch to Osmocom's git upstream -- not submit for review, just
+push a private branch.
+
+Why is that? The obs scripts here modify the git tree, so it is better to build
+the source packages on a separate git clone.
+
+ cd ~/osmo-dev/src/osmo-hnbgw
+ git push --set-upstream origin neels/gtpmap
+
+Clone source tree into the cache
+--------------------------------
+
+ cd ~/osmo-dev/src/osmo-ci/scripts/obs/
+ ./build_srcpkg.py osmo-hnbgw
+
+Now there is a git clone in ./_cache/osmo-hnbgw/
+
+Checkout my branch
+------------------
+
+#if 0
+ git -C _cache/osmo-hnbgw checkout neels/gtpmap
+#else
+One step of update_obs_project.py is to checkout the right branch.
+In order to checkout my branch, I add my branch as a feed to
+./lib/config.py:
+
+ ...
+ feeds = [
+ "2022q1",
+ "2022q2",
+ "latest",
+ "nightly",
+ "neels/gtpmap",
+ ]
+ ...
+
+Now I can tell update_obs_project.py to build my branch using the -f option (see
+below).
+#endif
+
+Build and upload source package to OBS
+--------------------------------------
+
+ ./update_obs_project.py -f neels/gtpmap home:nhofmeyr:test osmo-hnbgw
+
+See results
+-----------
+
+I can now see my hnbgw package listed:
+
+ $ osc list home:nhofmeyr:test
+ libosmo-pfcp
+ osmo-hnbgw
+
+I could query things via the osc tool:
+
+ $ osc results home:nhofmeyr:test osmo-hnbgw
+ neels_test2 aarch64 unresolvable
+ neels_test2 armv7l broken
+ neels_test2 i586 broken
+ neels_test2 x86_64 unresolvable
+ neels_test aarch64 unresolvable
+ neels_test armv7l unresolvable
+ neels_test i586 unresolvable
+ neels_test x86_64 failed
+
+Or point my web browser at
+https://obs.osmocom.org/project/show/home:nhofmeyr:test
diff --git a/scripts/obs/lib/config.py b/scripts/obs/lib/config.py
index 997fff2..517fe48 100644
--- a/scripts/obs/lib/config.py
+++ b/scripts/obs/lib/config.py
@@ -32,6 +32,7 @@
"2022q2",
"latest",
"nightly",
+ "neels/gtpmap",
]
# Osmocom projects: generated source packages will depend on a meta package,
diff --git a/scripts/obs/lib/srcpkg.py b/scripts/obs/lib/srcpkg.py
index 468a240..3fce993 100644
--- a/scripts/obs/lib/srcpkg.py
+++ b/scripts/obs/lib/srcpkg.py
@@ -132,6 +132,11 @@
if project in lib.config.projects_osmocom:
metapkg = f"osmocom-{feed}"
+
+ # replace special chars with '_' in the feed name,
+ # e.g. from a user's private git branch 'johndoe/wip'
+ metapkg = [c for c in metapkg if c.isalnum() else '_']
+
lib.debian.control_add_depend(project, metapkg, conflict_version)
if has_rpm_spec:
lib.rpm_spec.add_depend(project, metapkg, conflict_version)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29110
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I4d1303e0c04e827200b48a9fe4aea3680c9c9f84
Gerrit-Change-Number: 29110
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange