bugsnag / bugsnag-ruby

BugSnag error monitoring & reporting software for rails, sinatra, rack and ruby
https://docs.bugsnag.com/platforms/ruby
MIT License
246 stars 174 forks source link

SPA with ruby server project in subfolder and using capistrano option repo_tree #807

Closed stoivo closed 4 months ago

stoivo commented 7 months ago

We got a SPA project which we had as two repositories and recently we merged into one project. Previously both projects was in the root of respective repo. Now we have a client folder and a server folder. First idea was to deploy it like that and change nginx paths, but when we deploy bundle and rake expects the ruby project to be in the root of the git repo. After looking at options we found that capistrano has repo_tree option to deployes a subpath of the repo.

So to my issue. When exceptions are sent to bugsnags server the stacktrace would say app/controllers/graphql_controller.rb:41 but in by git repo it's server/app/controllers/graphql_controller.rb (starts with server). so the links don't work from stacktrace to source. I like this feature a lot so I want to see if you have seen this issue before and how I can solve it. I can stop using repo_tree and try to find a way to run bundle and rake in server. Other option is to change repo structure again and have the ruby project toplevel and have a client folder with all client stuff

Capistrano options: https://capistranorb.com/documentation/getting-started/configuration/

stoivo commented 6 months ago

Maybe I can refactor Bugsnag::Stacktrace so I can monkeymatch it to my needs? Are you open for such a PR?

clr182 commented 6 months ago

Hi @stoivo,

Thanks for reaching out. You could try setting the project_root a directory above there server/client folders. You can read more about the project_root configuration here in our documentation guide.

stoivo commented 6 months ago

I did play with the project_root setting but as I remove a starting /server from the project path I should add a server to the path where I am deploying and set project_root to be the parent of Rails root. I havn't tried this but I think I will have more issues so I don't like the suggestion

clr182 commented 6 months ago

Hi @stoivo,

I'm not sure I understand. Are you manually removing /server from the project path? Could you please elaborate on this issue further?

If you have one root folder where both the client folder and the server folder sit, you should set this root folder as your project_root, Then any errors that originate from the /server directory will include the /server path in the stack trace, and ditto with the \client directory.

mclack commented 4 months ago

Hi @stoivo

As there hasn't been any activity here for a while, we are now closing this issue.

If you continue to experience any problems, please feel free to reopen this issue along with any additional relevant information, or open a ticket with us directly by contacting support@bugsnag.com.