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

Enhancement: Version id (fka commit id) no longer accessible in viewer - Add "Copy Latest Version ID" to Model Card Actions #2243

Closed
5 tasks done
stephenburgess8 opened this issue May 3, 2024 · 3 comments
Labels
enhancement New feature or request question

Comments

@stephenburgess8
Copy link

stephenburgess8 commented May 3, 2024

Prerequisites

What package are you referring to?

frontend-2 only

Is your feature request related to a problem? Please describe.

In the previous version of the speckle server, the commits page provided a view of the commit including, crucially, the commit id. Information about that can be seen on this documentation page: https://speckle.guide/user/web.html

image

In this image from that page, the "id" at the top refers to the id of the commit (now I believe this is called the version id). In the new version of the Speckle Server frontend, there is no equivalent view of the old "Expand Data View" of the commit object. (note: please let me know if it is available and is something that I've missed).

When using specklepy, it's necessary to know the "commit id" to get the latest model. Our team had developed a workflow where we grabbed the latest commit ID from the expanded data view of the commit object when getting a project from our server instance. It would be nice to be able to access the version id in a way similar to how we used to access the commit id when we developed that workflow.

Describe the solution you'd like

It would be nice would be to add a command to "copy the latest version ID" to the actions on the model card on the project models page.

Screenshot 2024-05-03 at 3 10 50 PM

On the Models page for the Project, each Model (fka branch) has a drop down with options to copy the model id and the link. Since this model (branch) currently has its HEAD at the latest commit/version, it would make sense in my mind to provide a way for the user to copy the commit id at HEAD.

Describe alternatives you've considered

If it would be easier to make the version id copy accessible on the ViewerResourcesViewerCard that might work. That's the view showing the graphical list of versions for a model

The latest version id is used in the calculation of the props for each ViewerResourcesViewerCard. If it's accessible there I would assume it should be accessible elsewhere, hence my suggestion of adding it to the Model card dropdown..

:is-latest-version="version.id === latestVersionId"

I found out that the version id is used here because the latest version id is actually embedded in the url of the preview image.

Screenshot 2024-05-03 at 3 37 17 PM

The other alternative I've considered is a purely programmatic one in python. However it's possible others may find utility from having the latest version ID easily accessible in the speckle server frontend, so I wanted to propose it.

Additional context

I have experience working with Vue so I'd be willing to give this solution a shot if that would help.

Thanks for your work on this project.

Related issues or community discussions

I searched issues and community discussions but I couldn't find another reference to this.

@stephenburgess8 stephenburgess8 added enhancement New feature or request question labels May 3, 2024
@didimitrie
Copy link
Member

Hi @stephenburgess8, we've recently introduced "dev mode" which brings back a similar view of your commit in FE2: #2296

Would this be enough? Do note, we're not against adding that option to the model card (cc @benjaminvo)

@benjaminvo
Copy link
Contributor

benjaminvo commented Jun 11, 2024

Hi @stephenburgess8! Thanks for the thorough request.

On top of what Dim says, the latest version ID is also accessible from the versions page so I'm hesitant to add it to the model card (the versions page is not easy to find though but that's a separate issue).

CleanShot 2024-06-11 at 14 15 03@2x
CleanShot 2024-06-11 at 14 12 35@2x

@stephenburgess8
Copy link
Author

@didimitrie It's great to see the Raw Model Data view in Dev mode back again, thank you! I found out how to access it from this post: https://speckle.community/t/weekly-changelog-access-the-raw-model-data-with-dev-mode-and-more/11460

@benjaminvo In summary, as I understand it, each version of a model has both a Version Id and an object id/commit hash. An example of a Version ID for a model version is 5e9cb42780. An example of an object ID for the same model version is df837b380aefb4ff127b2e6c561943be. The former is accessible on the Version view and the latter is what specklepy needs. I'm trying to get the terminology about this correct but I apologize if I mispeak at all here.

There's a solution in specklepy to grab the latest commit as in the following pseudocode:

speckle_client = get_speckle_client(host = "https://speckle.xyz/")
stream_id = '12345'
commits = speckle_client.commit.list(stream_id)
object_id = get_object_id_of_most_recent_commit(commits)
raw_data_model = speckle_client.commit.get(stream_id, object_id)

https://github.com/specklesystems/specklepy/blob/main/src/specklepy/api/resources/commit.py#L20

Between the raw data model view and the specklepy solution to get the latest commit hash, I can access that object id again.

I wouldn't say no to having easy access to the object id alongside the version id in the version view, but it's now that the Raw Model Data view is back it's possible for me to get it from inside the web app again. I'll close this issue. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question
Projects
None yet
Development

No branches or pull requests

3 participants