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

fix: Update getSuffix to properly generate native sdk in pipeline #209

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

ksentak
Copy link
Contributor

@ksentak ksentak commented Aug 23, 2024

Issue

The CPP SDK was not generating properly when being ran in the GitHub Actions pipeline. The file that was not generating correctly was include/firebolt.h. The generateMethods() function inside of engine.mjs uses state.destination to determine a file suffix. For whatever reason firebolt.h has a state.destination of an entire file path. The problem is that GitHub Actions sometimes uses underscores in their file path such as /home/runner/_work. The existing suffix logic would not parse the file path correctly and cause the template generation for firebolt.h to break.

Fix

A new function called getSuffix() is introduced. It works in the following way:

  • The suffix is determined by the last underscore or period in the filename.
  • If the filename contains an underscore, the portion after the last underscore is considered the suffix.
  • If no underscore is found but there is a period, the portion after the last period (typically the file extension) is considered the suffix.
  • If neither an underscore nor a period is found, an empty string is returned.

@ksentak ksentak marked this pull request as ready for review August 26, 2024 13:32
@kevinshahfws kevinshahfws merged commit 16b4e6e into next Aug 26, 2024
7 checks passed
kschrief pushed a commit that referenced this pull request Aug 26, 2024
## [3.1.1-next.3](v3.1.1-next.2...v3.1.1-next.3) (2024-08-26)

### Bug Fixes

* Update getSuffix to properly work in pipeline ([#209](#209)) ([16b4e6e](16b4e6e))
@kschrief
Copy link
Contributor

🎉 This PR is included in version 3.1.1-next.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

kschrief pushed a commit that referenced this pull request Aug 30, 2024
## [3.1.1](v3.1.0...v3.1.1) (2024-08-30)

### Bug Fixes

* Add provider-selection tag to validation schema ([756e88a](756e88a))
* CPP Enum/AnyOf ([#210](#210)) ([eb768fb](eb768fb))
* Quote unsafe property names in languages that support it ([647043d](647043d))
* Return empty config, not null ([f02aadc](f02aadc))
* Update getSuffix to properly work in pipeline ([#209](#209)) ([16b4e6e](16b4e6e))
@kschrief
Copy link
Contributor

🎉 This PR is included in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ksentak ksentak deleted the fix-native-sdk-ci-build branch September 4, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants