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

(CONT-200) Fix require relative paths #1275

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

chelnak
Copy link
Contributor

@chelnak chelnak commented Oct 12, 2022

Prior to this PR using stdlib/to_toml function in a separate environment outside of production will result in the following error if the latest version doesn't also live in production:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- puppet_x/stdlib

This PR fixes the issue by updating code to use the correct paths for require_relative.

@chelnak chelnak requested a review from a team as a code owner October 12, 2022 18:40
@chelnak chelnak added the bugfix label Oct 12, 2022
@chelnak chelnak self-assigned this Oct 12, 2022
@@ -1,4 +1,4 @@
require 'puppet_x'
require_relative '../puppet_x'
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there maybe a rubocop rule we can use to enforce this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've not seen one.. it would be cool if there was though. Even something to warn and say "maybe you should use require_relative here" would be nice.

bastelfreak
bastelfreak previously approved these changes Oct 12, 2022
Prior to this commit using stdlib/to_toml function in a
separate environment outside of production will result
in the following error if the latest version doesn't
also live in production:

```
Error: Could not retrieve catalog from remote server:
Error 500 on SERVER: Internal Server Error:
org.jruby.exceptions.LoadError: (LoadError)
no such file to load -- puppet_x/stdlib
```

This commit fixes the issue by updating code to use the correct paths
for require_relative.
Copy link
Contributor

@pmcmaw pmcmaw left a comment

Choose a reason for hiding this comment

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

Failing tests are not in relation to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants