turbot / steampipe-plugin-github

Use SQL to instantly query repositories, users, gists and more from GitHub. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/github
Apache License 2.0
72 stars 28 forks source link

Refine error message for 'github_workflow' table during file parsing. Closes #436 #438

Closed ParthaI closed 2 months ago

ParthaI commented 3 months ago

Example query results

Results ``` > select name, path, workflow_file_content, workflow_file_content_json, pipeline from github_workflow where repository_full_name = 'turbot/steampipe-plugin-aws' +---------------------------------------+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------> | name | path | workflow_file_content | workflow_file_content_json > +---------------------------------------+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------> | Stale Issues and PRs | .github/workflows/stale.yml | name: Stale Issues and PRs | {"jobs":{"stale_workflow":{"uses":"turbot/steamp> | | | on: | > | | | schedule: | > | | | - cron: "30 23 * * *" | > | | | workflow_dispatch: | > | | | inputs: | > | | | dryRun: | > | | | description: Set to true for a dry run | > | | | required: false | > | | | default: "false" | > | | | type: string | > | | | | > | | | jobs: | > | | | stale_workflow: | > | | | uses: turbot/steampipe-workflows/.github/workflows/stale.yml@main | > | | | with: | > | | | dryRun: ${{ github.event.inputs.dryRun }} | > | | | | > | CodeQL | dynamic/github-code-scanning/codeql | | > | Build and Deploy OCI Image | .github/workflows/registry-publish.yml | name: Build and Deploy OCI Image | {"env":{"CONFIG_SCHEMA_VERSION":"2020-11-18","OR> | | | | nvalid version: $VERSION\"\n exit 1\nfi"},{"nam> | | | on: | pipe-plugin-${{ env.PLUGIN_NAME }}_linux_arm64.g> | | | push: | TRY_SA_KEY }}"}},{"run":"gcloud config list"},{"> | | | tags: | o \"VERSION=${GITHUB_REF#refs/*/}\" \u003e\u003e> Improved the error message: > select name, path, workflow_file_content, workflow_file_content_json from github_workflow where repository_full_name = 'pro-cloud-49/test37' Error: github: failed to populate column 'pipeline': failed to parse the workflow file 'https://github.com/pro-cloud-49/test37/blob/main/.github/workflows/test.yaml' (SQLSTATE HV000) +------+------+-----------------------+----------------------------+ | name | path | workflow_file_content | workflow_file_content_json | +------+------+-----------------------+----------------------------+ +------+------+-----------------------+----------------------------+ ```
misraved commented 3 months ago

@ParthaI could we also include the original error object along with the refined error message?

ParthaI commented 3 months ago

@misraved, I have pushed a change by including the original error object along with the refined error message. Thanks!