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

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

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jun 4, 2024

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         | <null>                                                                                                                             | <null>                                          >
| 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 |
+------+------+-----------------------+----------------------------+
+------+------+-----------------------+----------------------------+

@ParthaI ParthaI requested a review from misraved June 4, 2024 11:51
@ParthaI ParthaI self-assigned this Jun 4, 2024
@ParthaI ParthaI changed the title Improved the error message for the table github_workflow while parsing the file content Closes #436 Refine error message for 'github_workflow' table during file parsing. Closes #436 Jun 4, 2024
@ParthaI ParthaI linked an issue Jun 4, 2024 that may be closed by this pull request
@misraved
Copy link
Contributor

misraved commented Jun 4, 2024

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

@ParthaI
Copy link
Contributor Author

ParthaI commented Jun 4, 2024

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

@misraved misraved merged commit 8363ca8 into main Jun 17, 2024
1 check passed
@misraved misraved deleted the issue-436 branch June 17, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table github_workflow failing when workflow content is commented
2 participants