Skip to content

(CONT-200) Fix require relative paths#1275

Merged
pmcmaw merged 1 commit intomainfrom
CONT-200-fix_require_paths_for_puppet_x
Oct 13, 2022
Merged

(CONT-200) Fix require relative paths#1275
pmcmaw merged 1 commit intomainfrom
CONT-200-fix_require_paths_for_puppet_x

Conversation

@chelnak
Copy link
Copy Markdown
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
Comment thread lib/puppet_x/stdlib.rb Outdated
@@ -1,4 +1,4 @@
require 'puppet_x'
require_relative '../puppet_x'
Copy link
Copy Markdown
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
Copy Markdown
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.
@chelnak chelnak force-pushed the CONT-200-fix_require_paths_for_puppet_x branch from c29327c to 3312a18 Compare October 12, 2022 19:00
Copy link
Copy Markdown
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