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

Centralize the GetPackagePath #27004

Merged
merged 1 commit into from
May 15, 2024
Merged

Centralize the GetPackagePath #27004

merged 1 commit into from
May 15, 2024

Conversation

lieut-data
Copy link
Member

@lieut-data lieut-data commented May 14, 2024

Summary

As part of the change to eliminate MM_SERVER_PATH, I thought I had properly tested plugins relying on the server for tests, but apparently not, as these tests were now failing trying to resolve the i18n directory.

To remedy this, and address feedback from the first PR, I've centralized a single path.go in the server root from which all other paths are built. The return value from this also gets added to the search paths for resolving asset directories at runtime. (Like MM_SERVER_PATH did before, but now unconditionally.)

Tested this time with the MS Teams plugin and can confirm the before and after effect of this PR.

Ticket Link

None.

Release Note

NONE

@lieut-data lieut-data added 2: Dev Review Requires review by a developer QA/Review Not Required labels May 14, 2024
@mm-cloud-bot mm-cloud-bot added the release-note-none Denotes a PR that doesn't merit a release note. label May 14, 2024
As part of the change to [eliminate MM_SERVER_PATH](mattermost/enterprise#1676), I thought I had properly tested plugins relying on the server for tests, but apparently not, as these tests were now failing trying to resolve the `i18n` directory.

To remedy this, and address feedback from the first PR, I've centralized a single `path.go` in the `server` root from which all other paths are built. The return value from this also gets added to the search paths for resolving asset directories at runtime. (Like `MM_SERVER_PATH` did before, but now unconditionally.)
@lieut-data lieut-data marked this pull request as ready for review May 15, 2024 10:26
@lieut-data
Copy link
Member Author

lieut-data commented May 15, 2024

@agnivade & @wiggin77, despite my claims otherwise, my changes to MM_SERVER_PATH did require some reworking for plugins (though thankfully only as they updated the server dependencies).

I've re-tested this again with MS Teams, but would love your eyes again :)

@lieut-data
Copy link
Member Author

/e2e-test

@unified-ci-app
Copy link
Contributor

E2E test triggered successfully for PR #27004, commit 556e7b3a26bc7ddd54af13f7b39ae50e8705ccea. The corresponding commit's status check will be available shortly.

Copy link
Member

@wiggin77 wiggin77 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 One thing that comes to mind that I should have included in the previous review... the GetPackagePath implementation may break if the place it is called from gets inlined. I think it's possible the result will be wrong if the inlined function is called from a different package.

@lieut-data
Copy link
Member Author

Good call out, @wiggin77! I'll keep this in mind if we see unexpected breakage in the future.

@lieut-data lieut-data merged commit cd51dec into master May 15, 2024
42 checks passed
@lieut-data lieut-data deleted the single-root-server-path branch May 15, 2024 15:05
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels May 15, 2024
@jwilander jwilander added the kind/refactor Categorizes issue or PR as related to refactor of production code. label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a developer Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation kind/refactor Categorizes issue or PR as related to refactor of production code. QA/Review Not Required release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants