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

fixing could not find desired block (fixes #48) #49

Merged
merged 4 commits into from
Feb 3, 2023

Conversation

sio4
Copy link
Member

@sio4 sio4 commented Feb 1, 2023

What is being done in this PR?

The CLI now generated an application scaffold with the appOnce.Do() style since v0.18.9 to prevent double initialization, but we didn't update the plugins yet. This PR will fix this issue.

fixes #48

What are the main choices made to get to this solution?

What was discovered while working on it? (Optional)

If you generate goth not right after the app generation but after having some resources, you need to care about the position of the goth-related lines. However, the generator just adds the lines at the end of the code block now. Move the added code to a proper location, and check the middleware stack with buffalo task middleware.

The reason for the behavior is that app.Resource() duplicates the app as a group of endpoints, and the group, actually an app, has its own middleware stack. So if you configure goth middleware after forking the app, the forked one will not be affected by the middleware assignment.

List the manual test cases you've covered before sending this PR:

  • Tested with a simple app by installing local binary plugins (buffalo plugins install /path/to/buffalo-goth)

@sio4 sio4 added the bug label Feb 1, 2023
@sio4 sio4 requested a review from a team February 1, 2023 17:10
@sio4 sio4 self-assigned this Feb 1, 2023
@sio4 sio4 added this to the v1.5.0 milestone Feb 1, 2023
@sio4 sio4 merged commit 15d670d into main Feb 3, 2023
@sio4 sio4 deleted the fixing-could-not-find-desired-block branch February 3, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant