intel / ledmon

Enclosure LED Utilities
GNU General Public License v2.0
72 stars 49 forks source link

[BUG]: Incompatible API change was made with https://github.com/intel/ledmon/pull/211 #226

Closed tasleson closed 6 months ago

tasleson commented 6 months ago

Description

PR: https://github.com/intel/ledmon/pull/211 changed a public facing constant. This is forbidden for a public API as it breaks all the clients that use the API.

1.0.0 was released with

LED_IBPI_PATTERN_LOCATE_AND_FAILED_DRIVE

which was replaced with

LED_IBPI_PATTERN_LOCATE_AND_FAIL

version 1.0.0 was packaged for fedora and I made changes for libstoragemgmt to utilize it.

Steps to reproduce bug

Wrte client code that uses version 1.0.0 and compile, update to latest version of source tree and compile will fail because constant no longer exists.

Expected behavior

Client code continues to build without errors.

Actual behavior

Client clode fails to compile

Environment

NA

Ledmon version

1.0.0 vs current main

Ledmon logs

No response

Ledctl logs

No response

Ledmon supported controllers

NA

Additional information

I believe we have a couple options:

  1. Revert that change
  2. Introduce a #ifdef in the header

define LED_IBPI_PATTERN_LOCATE_AND_FAILED_DRIVE LED_IBPI_PATTERN_LOCATE_AND_FAILED

mtkaczyk commented 6 months ago

PR: https://github.com/intel/ledmon/pull/211 changed a public facing constant. This is forbidden for a public API as it breaks all the clients that use the API.

Yes, of course sorry for that. Thanks for fast report. I wanted to make it shorter that is all :)

tasleson commented 6 months ago

Yes, of course sorry for that. Thanks for fast report. I wanted to make it shorter that is all :)

I understand, I think we can leave it as long as we add the #define to maintains backwards compatibility.