Skip to content

Add Yard method annotation for Remote Dev services/lib modules

Chad Woolley requested to merge caw-rd-add-yard-for-services-and-lib into master

What does this MR do and why?

Soon we will be making significant refactors to the Remote Development services and lib folders to address various technical debt follow up issues (Technical debt and follow-up work from Beta rel... (&10498 - closed)) and upcoming new features.

The majority of the current developers on the Remote Dev team use JetBrains IDEs, and can rely on its support for YARD annotations to provide instant feedback and Inspect Code static analysis for potential type mismatches.

This also is an initial step towards providing type metadata which will be useful as we work towards modularizing the monolith (Add GitLab Modular Monolith design document (!121520 - merged)), enforcing domain boundaries, and identifying potential circular dependencies.

How to set up and validate locally

The setup for this has been documented here: https://gitlab.com/gitlab-org/remote-development/gitlab-remote-development-docs/-/blob/main/doc/local-development-environment-setup.md#scopes

More context

(from comment thread below)

I don't know if YARD is the best approach to use for type safety. If we did this on a larger scale, we might want to consider something more powerful and modern like RBS (the official type system of Ruby now), and/or Sorbet (not official, but older more useful/powerful than RBS in some ways).

But that would involve more buy-in and work, even though there's already some YARD annotations scattered around the codebase.

I also don't even know if we'll want to keep these YARD annotations around or not.

But I wanted to try it, especially to give me some IDE help as I work on the big refactor in progress. And this is only isolated to theses specific area of the remote dev code, so it should have little to no impact on anyone else in the codebase.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Chad Woolley

Merge request reports