Skip to content

Conversation

@mdb
Copy link
Contributor

@mdb mdb commented Dec 14, 2024

This addresses issue #2513 and adds support for a github_release_asset data source.

Example of passing acceptance tests:

GITHUB_ORGANIZATION=mterwill \
GITHUB_OWNER=mterwill \
TF_ACC=1 \
  go test -v ./... -run ^TestAccGithubReleaseAssetDataSource
?       github.com/integrations/terraform-provider-github/v6    [no test files]
=== RUN   TestAccGithubReleaseAssetDataSource
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account
    provider_utils.go:51: GITHUB_TOKEN environment variable should be empty
    provider_utils.go:74: Skipping TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account which requires anonymous mode
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account
--- PASS: TestAccGithubReleaseAssetDataSource (11.65s)
    --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID (11.65s)
        --- SKIP: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account (0.00s)
        --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account (8.90s)
        --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account (2.75s)
PASS
ok      github.com/integrations/terraform-provider-github/v6/github     12.434s

Resolves #2513


Before the change?

  • The provider did not support a github_release_asset data source

After the change?

  • The provider supports a github_release_asset data source

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

No.

Please see our docs on breaking changes to help!

  • Yes
  • No

@mdb mdb force-pushed the mdb/gh-release-asset branch from dac6b1b to 696957f Compare December 17, 2024 13:27
@mdb mdb marked this pull request as ready for review December 17, 2024 13:28
@mdb
Copy link
Contributor Author

mdb commented May 4, 2025

Hi @lafrenierejm - This has been waiting on reviews for ~6 months. Is there anything I can do to help steward this along to get it reviewed, merged, and released?

@mdb
Copy link
Contributor Author

mdb commented May 5, 2025

Hi @kfcampbell - I believe you've merged/released other PRs. Is there anything I can do to help steward this along to get it reviewed, merged, and released? Thanks!

@mdb
Copy link
Contributor Author

mdb commented Dec 19, 2025

@deiga Given your help reviewing PR #2515, would you mind reviewing this as well? Thanks!

@deiga
Copy link
Contributor

deiga commented Dec 20, 2025

Hey @mdb 👋

Thanks for the contribution!

The changes look good for the most part.
I have a few requests for you:

  • Could you elaborate the headers change? The comment wasn't enough for me to understand what is happening.
  • I wonder if it'd be possible to get a test for the headers change which ensures that it doesn't break any behaviour?
  • We're moving towards Context-aware provider functions, could you refactor the Schemata to use ReadContext?
  • We're also going to start using documentation generating from resource/data source Descriptions. Could you ensure that all necessary info is in the different Description fields of the Schemata?

@mdb mdb force-pushed the mdb/gh-release-asset branch from 0671ab4 to 9b364b5 Compare December 21, 2025 11:51
This addresses issue integrations#2513 and adds support for a `github_release_asset`
data source.

Example of passing acceptance tests:

```
GITHUB_ORGANIZATION=mterwill \
GITHUB_OWNER=mterwill \
TF_ACC=1 \
  go test -v ./... -run ^TestAccGithubReleaseAssetDataSource
?       github.com/integrations/terraform-provider-github/v6    [no test files]
=== RUN   TestAccGithubReleaseAssetDataSource
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account
    provider_utils.go:51: GITHUB_TOKEN environment variable should be empty
    provider_utils.go:74: Skipping TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account which requires anonymous mode
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account
=== RUN   TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account
--- PASS: TestAccGithubReleaseAssetDataSource (11.65s)
    --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID (11.65s)
        --- SKIP: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_anonymous_account (0.00s)
        --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_individual_account (8.90s)
        --- PASS: TestAccGithubReleaseAssetDataSource/queries_specified_asset_ID/with_an_organization_account (2.75s)
PASS
ok      github.com/integrations/terraform-provider-github/v6/github     12.434s
```

Signed-off-by: Mike Ball <mikedball@gmail.com>
@mdb mdb force-pushed the mdb/gh-release-asset branch from 9b364b5 to 2407ae3 Compare December 21, 2025 11:58
Per request of @deiga (integrations#2514 (comment)),
this adds tests for previewHeaderInjectorTransport.RoundTrip logic
around application/octest-stream header handling.

See google/go-github#3392 for context.

Signed-off-by: Mike Ball <mikedball@gmail.com>
@mdb
Copy link
Contributor Author

mdb commented Dec 21, 2025

Thanks for the quick response @deiga !

  • Could you elaborate the headers change? The comment wasn't enough for me to understand what is happening.

I've added a comment linking to corresponding context over in google/go-github#3392 (and note that this is fixed in go-github/v68 (Admittedly, this is all a bit foggy for me -- it's been over a year since I opened this PR as well as since I opened google/go-github#3392)).

  • I wonder if it'd be possible to get a test for the headers change which ensures that it doesn't break any behaviour?

I added unit tests. Does that address your concern?

  • We're moving towards Context-aware provider functions, could you refactor the Schemata to use ReadContext?

Done!

  • We're also going to start using documentation generating from resource/data source Descriptions. Could you ensure that all necessary info is in the different Description fields of the Schemata?

Done!

@mdb
Copy link
Contributor Author

mdb commented Jan 4, 2026

@deiga 👋 Gentle nudge! Have I addressed your concerns in the response above?

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.

[FEAT]: Support github_release_asset data source

2 participants