Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

export series metadata with raw debug#49473

Merged
coury-clark merged 5 commits into
mainfrom
cclark/export-series-metadata-in-raw-debug
Mar 16, 2023
Merged

export series metadata with raw debug#49473
coury-clark merged 5 commits into
mainfrom
cclark/export-series-metadata-in-raw-debug

Conversation

@coury-clark

@coury-clark coury-clark commented Mar 15, 2023

Copy link
Copy Markdown
Contributor

Closes https://github.com/sourcegraph/sourcegraph/issues/49446

  1. Adds the entire insight series row to the raw debug endpoint
  2. Fixes a bug where errors were not marshalling because they were private fields

Test plan

Running locally, hit the insightViewDebug endpoint and got this:

{
  "data": {
    "insightViewDebug": {
      "raw": [
        {
          "QueueStatus": {
            "SeriesId": "2Isekw8PhTksphApwp08gqzebUM",
            "Query": "type:commit",
            "Enabled": false,
            "Errored": 0,
            "Processing": 0,
            "Queued": 0,
            "Failed": 0,
            "Completed": 2,
            "SearchErrors": null
          },
          "Backfills": [
            {
              "Info": {
                "Id": 65,
                "RepoIteratorId": 62,
                "EstimatedCost": 8000,
                "State": "completed",
                "StartedAt": "2022-12-13T23:41:11.80836Z",
                "CompletedAt": "2022-12-13T23:42:50.405542Z",
                "RuntimeDuration": null,
                "PercentComplete": 1,
                "NumRepos": 1
              },
              "Errors": []
            }
          ],
          "SeriesMetadata": {
            "id": 65,
            "series_id": "2Isekw8PhTksphApwp08gqzebUM",
            "query": "type:commit",
            "created_at": "2022-12-13T23:41:04.135542",
            "oldest_historical_at": "2022-06-14T23:41:04.135543",
            "last_recorded_at": "2023-03-15T22:23:27.176747",
            "next_recording_after": "2023-03-16T22:23:27.176747",
            "deleted_at": null,
            "backfill_queued_at": "2022-12-13T23:41:04.145383",
            "last_snapshot_at": "2023-03-15T22:23:27.292943",
            "next_snapshot_after": "2023-03-16T00:00:00",
            "repositories": [
              "github.com/sourcegraph/sourcegraph"
            ],
            "sample_interval_unit": "DAY",
            "sample_interval_value": 1,
            "generated_from_capture_groups": false,
            "generation_method": "search",
            "just_in_time": false,
            "group_by": null,
            "backfill_attempts": 0,
            "needs_migration": false,
            "backfill_completed_at": "2022-12-13T23:42:50.405542",
            "supports_augmentation": true,
            "repository_criteria": null
          }
        }
      ]
    }
  }
}

@cla-bot cla-bot Bot added the cla-signed label Mar 15, 2023
@coury-clark coury-clark self-assigned this Mar 15, 2023
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff d391344...6287545.

Notify File(s)
@efritz internal/database/migration/shared/data/stitched-migration-graph.json

@coury-clark coury-clark enabled auto-merge (squash) March 15, 2023 23:43

@chwarwick chwarwick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change looks good, but not sure if that siticed-migration-graph.json should be there.

@coury-clark coury-clark merged commit 9f04c08 into main Mar 16, 2023
@coury-clark coury-clark deleted the cclark/export-series-metadata-in-raw-debug branch March 16, 2023 14:33
github-actions Bot pushed a commit that referenced this pull request Mar 16, 2023
Closes https://github.com/sourcegraph/sourcegraph/issues/49446

1. Adds the entire insight series row to the raw debug endpoint
2. Fixes a bug where errors were not marshalling because they were
private fields

## Test plan

Running locally, hit the `insightViewDebug` endpoint and got this:

``` json
{
  "data": {
    "insightViewDebug": {
      "raw": [
        {
          "QueueStatus": {
            "SeriesId": "2Isekw8PhTksphApwp08gqzebUM",
            "Query": "type:commit",
            "Enabled": false,
            "Errored": 0,
            "Processing": 0,
            "Queued": 0,
            "Failed": 0,
            "Completed": 2,
            "SearchErrors": null
          },
          "Backfills": [
            {
              "Info": {
                "Id": 65,
                "RepoIteratorId": 62,
                "EstimatedCost": 8000,
                "State": "completed",
                "StartedAt": "2022-12-13T23:41:11.80836Z",
                "CompletedAt": "2022-12-13T23:42:50.405542Z",
                "RuntimeDuration": null,
                "PercentComplete": 1,
                "NumRepos": 1
              },
              "Errors": []
            }
          ],
          "SeriesMetadata": {
            "id": 65,
            "series_id": "2Isekw8PhTksphApwp08gqzebUM",
            "query": "type:commit",
            "created_at": "2022-12-13T23:41:04.135542",
            "oldest_historical_at": "2022-06-14T23:41:04.135543",
            "last_recorded_at": "2023-03-15T22:23:27.176747",
            "next_recording_after": "2023-03-16T22:23:27.176747",
            "deleted_at": null,
            "backfill_queued_at": "2022-12-13T23:41:04.145383",
            "last_snapshot_at": "2023-03-15T22:23:27.292943",
            "next_snapshot_after": "2023-03-16T00:00:00",
            "repositories": [
              "github.com/sourcegraph/sourcegraph"
            ],
            "sample_interval_unit": "DAY",
            "sample_interval_value": 1,
            "generated_from_capture_groups": false,
            "generation_method": "search",
            "just_in_time": false,
            "group_by": null,
            "backfill_attempts": 0,
            "needs_migration": false,
            "backfill_completed_at": "2022-12-13T23:42:50.405542",
            "supports_augmentation": true,
            "repository_criteria": null
          }
        }
      ]
    }
  }
}
```

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

(cherry picked from commit 9f04c08)
sqs pushed a commit that referenced this pull request Mar 18, 2023
Closes https://github.com/sourcegraph/sourcegraph/issues/49446

1. Adds the entire insight series row to the raw debug endpoint
2. Fixes a bug where errors were not marshalling because they were
private fields

## Test plan

Running locally, hit the `insightViewDebug` endpoint and got this:

``` json
{
  "data": {
    "insightViewDebug": {
      "raw": [
        {
          "QueueStatus": {
            "SeriesId": "2Isekw8PhTksphApwp08gqzebUM",
            "Query": "type:commit",
            "Enabled": false,
            "Errored": 0,
            "Processing": 0,
            "Queued": 0,
            "Failed": 0,
            "Completed": 2,
            "SearchErrors": null
          },
          "Backfills": [
            {
              "Info": {
                "Id": 65,
                "RepoIteratorId": 62,
                "EstimatedCost": 8000,
                "State": "completed",
                "StartedAt": "2022-12-13T23:41:11.80836Z",
                "CompletedAt": "2022-12-13T23:42:50.405542Z",
                "RuntimeDuration": null,
                "PercentComplete": 1,
                "NumRepos": 1
              },
              "Errors": []
            }
          ],
          "SeriesMetadata": {
            "id": 65,
            "series_id": "2Isekw8PhTksphApwp08gqzebUM",
            "query": "type:commit",
            "created_at": "2022-12-13T23:41:04.135542",
            "oldest_historical_at": "2022-06-14T23:41:04.135543",
            "last_recorded_at": "2023-03-15T22:23:27.176747",
            "next_recording_after": "2023-03-16T22:23:27.176747",
            "deleted_at": null,
            "backfill_queued_at": "2022-12-13T23:41:04.145383",
            "last_snapshot_at": "2023-03-15T22:23:27.292943",
            "next_snapshot_after": "2023-03-16T00:00:00",
            "repositories": [
              "github.com/sourcegraph/sourcegraph"
            ],
            "sample_interval_unit": "DAY",
            "sample_interval_value": 1,
            "generated_from_capture_groups": false,
            "generation_method": "search",
            "just_in_time": false,
            "group_by": null,
            "backfill_attempts": 0,
            "needs_migration": false,
            "backfill_completed_at": "2022-12-13T23:42:50.405542",
            "supports_augmentation": true,
            "repository_criteria": null
          }
        }
      ]
    }
  }
}
```

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

export repo query in code insights debug endpoint

3 participants