Skip to content

[MAINT]: Logic flaws with etag support #3103

Description

@stevehipwell

Describe the need

The current etag pattern is embedded in the business logic instead of being a transport concern. This pattern not only requires that each resource opt into supporting etags with all of the additional complexity that it entails, but it also means that there is no resource returned when we get a 304 form an endpoint.

Based on #3085 I've discovered that at least one of the etag patterns used is defective when there is an error in an update as read will be skipped causing there to be no diff. This logic is unsound on 2 points, the error scenario (as previously mentioned) and if a resource (or data source) schema is modified while the etag doesn't change. With the current implementation I think we have the following options.

  1. Remove etag support
  2. Keep etag support but make changes
    a. Clear etag on update error
    b. Increment schema version for all field changes and clear etag as part of the migration

Based on the above options I'm leaning towards removing etags in most cases (where the schema is likely to change) as the benefit they provide would be significantly outweighed by the overhead of incrementing schema versions for every change.

Longer term I'd suggest that we look at integrating bored-engineer/github-conditional-http-transport to support etag and cached responses at the transport layer.

SDK Version

No response

API Version

No response

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Type: Maintenance
    on Jan 20, 2026
  2. github-actions commented on Jan 20, 2026

    @github-actions

    👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

  3. mikutas commented on Jan 21, 2026

    @mikutas
    Contributor

    encountered this issue with
    notification_setting of github_team
    and
    rules.pull_request.allowed_merge_methods of github_repository_ruleset
    when upgrading from 6.8.3 to 6.10.1

    TF_LOG=DEBUG reports GitHub API returns 304 not modified with no response body

  4. deiga commented on Jan 21, 2026

    @deiga
    Collaborator

    Yes, this sounds that it definitely needs to be addressed.

    Initially I would say that removing it entirely doesn't sound great, since it has a big impact on the rate limit usage of the provider.

    We should be increasing it's usage, if we can find a way to make this more reliable.
    Like you mentioned, we should not be storing etag if apply fails

    Adding a way to allow the user to force a refresh would also be good.

  5. added a commit that references this issue on Mar 30, 2026
    23a52ec
  6. stevehipwell commented on May 26, 2026

    @stevehipwell
    CollaboratorAuthor

    FYI the current etag pattern only works with a fixed token, as soon as the token changes the etag is invalid. Given the fact that the etags are single resource scoped they are of very limited value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions