Bug 282759 - sysutils/snmp_exporter: update to 0.28.0
Summary: sysutils/snmp_exporter: update to 0.28.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-14 15:12 UTC by Lexi Winter
Modified: 2025-03-16 10:25 UTC (History)
5 users (show)

See Also:
Alexander88207: maintainer-feedback-


Attachments
patch (27.26 KB, patch)
2024-11-14 15:12 UTC, Lexi Winter
no flags Details | Diff
patch (25.04 KB, patch)
2025-02-28 08:35 UTC, Lexi Winter
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lexi Winter freebsd_triage 2024-11-14 15:12:05 UTC
Created attachment 255171 [details]
patch

- update to 0.26.0 (new upstream release)
- add new port sysutils/snmp_exporter20 containing the previous version (0.20.0), for users who want to continue using their existing configuration.
- add a pkg-message and UPDATING entry to document the breaking change and the new port
- while here, switch from GH_TUPLE to go:modules.

NB, i added the existing maintainer as maintainer for the new port.  i would be willing to maintain both ports, but i do not want to maintain snmp_exporter20 only since i don't use it (but i did test it).

tested on FreeBSD 15.0/arm64.
Comment 1 Alexander Vereeken freebsd_triage 2024-11-29 18:22:21 UTC
Maintainer Timeout.
Comment 2 Gleb Popov freebsd_committer freebsd_triage 2024-12-24 05:04:40 UTC
Changes like

-	content, err := ioutil.ReadFile("generator.yml")
+	content, err := ioutil.ReadFile("/usr/local/etc/snmp_exporter/generator.yml")

look suspicious. I don't think our port should diverge from what the upstream does. And the "/usr/local" can't be hardcoded into patches too.
Comment 3 Lexi Winter freebsd_triage 2024-12-25 07:33:11 UTC
it's technically not hardcoded into the patch as the Makefile replaces it with ${LOCALBASE} later.  but i didn't add this, it was already part of the port.  do you want me to refactor it to remove this?  (i suppose this will require providing these paths in the rc.d script instead.)
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2024-12-25 07:38:03 UTC
Since the upstream uses relative paths, the software is expected to be run in a specific working dir. In this case it is the rc.d script's responsibility to cd into a correct directory. Patching in absolute paths will also prevent an user from running the program manually in his own working dir.

So yes, if I'm not missing something, then the paths patch should be removed and rc.d script should be taught to change the dir instead.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2025-02-13 14:44:04 UTC
Any progress?
Comment 6 Lexi Winter freebsd_triage 2025-02-23 20:00:45 UTC
i'm hoping to have a new patch this week, my spare time has been taken by other things recently, sorry!
Comment 7 Lexi Winter freebsd_triage 2025-02-28 08:35:18 UTC
Created attachment 258056 [details]
patch

new patch:

- update to 0.28.0
- remove the local patch to generator/main.go
- fix developer warning in Makefile (GH_PROJECT)
- document two more breaking changes in upstream, and the removal of the local generator patch

i haven't removed the generator patch from sysutils/snmp_exporter20 because the purpose of that port is to avoid breaking changes.
Comment 8 Robert Clausecker freebsd_committer freebsd_triage 2025-02-28 10:55:43 UTC
(In reply to Lexi Winter from comment #7)

Thank you for the update.

Would you like to take up maintainership over this port?
Comment 9 Lexi Winter freebsd_triage 2025-02-28 10:57:06 UTC
as there's been no update from the current maintainer and i use this port extensively, i would be happy to take over maintainership.
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-03-16 10:21:31 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=acc7dc88f94413568e8feba7e03db323a28b69dd

commit acc7dc88f94413568e8feba7e03db323a28b69dd
Author:     Lexi Winter <lexi@hemlock.eden.le-fay.org>
AuthorDate: 2024-11-14 14:15:44 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-03-16 10:19:27 +0000

    sysutils/snmp_exporter: update to 0.28.0

    Assign maintainership to submitter.

    changes since the previous port version (0.20.0) are too numerous to
    list here but can be found at the GitHub releases page:

      https://github.com/prometheus/snmp_exporter/releases

    this release introduces a breaking change in the configuration file
    format.  to address this:

    - add a new pkg-message that explains the situation on upgrade.

    - add an UPDATING entry to warn ports users about the change.

    - add a new port called 'sysutils/snmp_exporter20' containing the old
      0.20.0 version; users who don't want to immediately update their
      configuration can instead switch to this new port to continue using
      the old version.

    PR:             282759
    Approved by:    fabian.freyer@physik.tu-berlin.de (maintainer timeout)

 UPDATING                                           | 30 +++++++++++
 sysutils/snmp_exporter/Makefile                    | 37 ++------------
 sysutils/snmp_exporter/distinfo                    | 56 ++------------------
 sysutils/snmp_exporter/files/pkg-message.in        | 39 ++++++++++++++
 sysutils/snmp_exporter20/Makefile (new)            | 59 ++++++++++++++++++++++
 sysutils/snmp_exporter20/distinfo (new)            | 51 +++++++++++++++++++
 sysutils/snmp_exporter20/files/generator.yml (new) | 23 +++++++++
 .../files/patch-generator_main.go                  |  0
 .../snmp_exporter20/files/pkg-message.in (new)     | 13 +++++
 .../snmp_exporter20/files/snmp_exporter.in (new)   | 57 +++++++++++++++++++++
 sysutils/snmp_exporter20/pkg-descr (new)           |  3 ++
 sysutils/snmp_exporter20/pkg-plist (new)           |  3 ++
 12 files changed, 286 insertions(+), 85 deletions(-)
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2025-03-16 10:25:38 UTC
Thank you for your contribution.
Sorry for the slow commit.