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

Ensure test group exists before trying to add examples #2275

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

vinistock
Copy link
Member

Motivation

This fixes another error found in our telemetry. We are sometimes getting test example code lens that are associated to a group_id for a group that doesn't exist.

It's difficult to figure out exactly in what scenario this happens, but given that addons can contribute test code lens, we should protect the extension from invalid data anyway.

Implementation

We still had code in the test controller to account for the previous behaviour of code lens, which didn't include group IDs. It's been a long time since we released that, so I think it's safe to remove at this point. If anyone reports issues related to very old server versions, we can just ask them to update.

Other than simplifying the code after removing that old code lens handling, the fix is simply the check that the group exists before trying to add children. Otherwise, we print an error to the output channel.

Automated Tests

Created a test for the test controller, which was missing.

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels Jul 9, 2024
@vinistock vinistock self-assigned this Jul 9, 2024
@vinistock vinistock requested a review from a team as a code owner July 9, 2024 18:00
@vinistock vinistock requested review from andyw8 and st0012 July 9, 2024 18:00
Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against ruby-lsp-rspec-using projects and the tree displays the same AFAICT 👍

@vinistock vinistock merged commit 65f61f8 into main Jul 10, 2024
35 checks passed
@vinistock vinistock deleted the vs/fix_missing_group_error_in_test_controller branch July 10, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants