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

[fix]: skip file-specifc schema data for directory #1949

Merged
merged 6 commits into from
Oct 10, 2023

Conversation

prestonvasquez
Copy link
Contributor

@prestonvasquez prestonvasquez commented Oct 10, 2023

Resolves #1930


Before the change?

Using a directory as the file in a data block will result in a segmentation violation, e.g.

data "github_repository_file" "directory" {
  repository = local.repo
  branch     = local.branch
  file       = "vendor"
}

After the change?

This change is based on the observation that file information cannot be extracted from a slice of github.RepositoryContent. Therefore, if the "file" parameter passed to the "dataSourceGithubRepositoryFileRead" function refers to a directory, we should skip attempting to retrieve file-specific content.

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) NA

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@nickfloyd nickfloyd added Type: Bug Something isn't working as documented hacktoberfest Issues for participation in Hacktoberfest labels Oct 10, 2023
@nickfloyd nickfloyd changed the title #1930 skip file-specifc schema data for directory [fix]: skip file-specifc schema data for directory Oct 10, 2023
@nickfloyd
Copy link
Contributor

Non breaking change since the behavior was a seg violation and not a clean exit. The behavior is as intended with this PR.

@nickfloyd
Copy link
Contributor

Thank you @prestonvasquez for theses commits! ❤️

@nickfloyd nickfloyd merged commit 8753d3c into integrations:main Oct 10, 2023
3 checks passed
@prestonvasquez prestonvasquez deleted the issue-1930 branch October 10, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues for participation in Hacktoberfest Type: Bug Something isn't working as documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: SIGSEGV when github_repository_file is given a directory
2 participants