Provide `permalink_path` like functionality for directories via graphQL

Problem

On the frontend, we are adding Permalink control to directory pages, but we're lacking the data that's available on blob to compose the permalink for a directory.

See the analysis

Solution

We'll need something like permalink_path found on RepositoryBlob but for directories. There's probably an existing type that deals with directories that we can add this functionality to.

Possible implementation options (from refinement phase)

While the permalink_path provides context to how permalinks are generated for individual files, consider these other options dealing with directories:

  1. Create a new DirectoryPresenter or TreePresenter class specifically for directory-related functionality (instead of putting the new code in BlobPresenter)
  2. Add the method to an existing class that deals with directories, maybe TreeType or RepositoryType.
  3. Extend the RepositoryPresenter, as it might be a more suitable place for both file and directory operations.

The method linked in the description for permalink_path in the BlobPresenter is specific to individual files. For directories, you'd need to create a similar method that doesn't rely on the blob's commit_id and path, but instead uses the directory's path and something like the current commit SHA.

These are just some possible options but trying it will take a little more investigation. I think since we can expect to require some collaboration with frontend (make sure the new data is provided in a way that works for what they need) and there's the possibility of needing to understand something on the gitaly side I'll weight this as a 3. It might turn out a little simpler than that but that's my best guess.

Notes

Required permissions and access levels should be the same as for blob permalink.

The data on frontend will be queried with ee_else_ce/repository/queries/project_info.query.graphql

Edited by Paulina Sedlak-Jakubowska