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

make github_ref respect owner #1651

Merged
merged 4 commits into from
Apr 18, 2023
Merged

make github_ref respect owner #1651

merged 4 commits into from
Apr 18, 2023

Conversation

ksatirli
Copy link
Contributor

Hello maintainers 👋🏼

Resolves #1650


Behavior

Before the change?

  • The github_ref data source is not able to provide data on repositories that are not of the same owner as the PAT / token
  "etag" = tostring(null)
  "id" = tostring(null)
  "ref" = tostring(null)
  "repository" = tostring(null)
  "sha" = tostring(null)

After the change?

  • The github_ref data source is able to provide data on repositories that are not of the same owner as the PAT / token
  "etag" = "W/\"a1946ae73434cb3bcf8720087f56b426943582a4debb54785c4d43d631b581dc\""
  "id" = "setup-terraform:tags/v2.0.3"
  "owner" = "hashicorp"
  "ref" = "tags/v2.0.3"
  "repository" = "setup-terraform"
  "sha" = "633666f66e0061ca3b725c73b2ec20cd13a8fdd1"

Other information


Additional info

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)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

The github_ref data source now requires an owner attribute. I marked it as required in the code, which brings this data source in line with other data sources.

Not providing an owner would result in Terraform informing the user of a missing attribute (owner), which could break a deployment.

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • No

If Yes, what's the impact:

  • When using the github_ref data source, an owner attribute must now be provided.

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug

@kfcampbell
Copy link
Member

As we discussed on Slack, let's try making the owner optional so that we can release this as a non-breaking change. Would you like to do that? Should I push commits to this PR?

@kfcampbell
Copy link
Member

Psst...hi! I don't want to step on your toes here but it would be great to get this in soon. Want me to make the owner optional?

@ksatirli
Copy link
Contributor Author

I'd love to get this in ASAP, too!

This week and early of next are fully booked, so if you can get to it earlier, please do!

Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

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

I've tested this locally and it works! This is a change we probably need to make across many resources. I've opened #1655 to track this work.

Thank you for contributing!

@kfcampbell kfcampbell merged commit e9bb788 into integrations:main Apr 18, 2023
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
* make `github_ref` respect `owner` (instead of deriving it from the token)

* `id` is also exported and should be mentioned

* If no owner specified, use owner of token

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
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.

[MAINT]: Make github_ref respect owner (vs taking it from the PAT)
2 participants