Skip to content

Support fetching-then-parsing-with-key#110

Merged
rtyley merged 1 commit intomainfrom
support-fetching-then-parsing-with-key
Oct 15, 2025
Merged

Support fetching-then-parsing-with-key#110
rtyley merged 1 commit intomainfrom
support-fetching-then-parsing-with-key

Conversation

@rtyley
Copy link
Member

@rtyley rtyley commented Sep 3, 2025

This is motivated by fixing Prout's flakey integration tests:

The one blocker for play-git-hub using our own etag-caching library is that the library currently only provides the response to the parser. Yet GitHub API responses do not contain a discriminator which makes it easy to work out what the correct parser is to use - is the response a Repo, a PullRequest or what!? Therefore we need etag-caching to support parser functions that require knowledge of the key, as well as the raw response.

Changes

  • Add a new fetching.thenParsingWithKey() syntax to complement the fetching.thenParsing() method of instantiating a Loading instance - which passes the key, as well as the raw response, to the parser.
  • Drop the Loading.by(fetching)(parser) syntax for instantiating a Loading instance, in favour of the alternative fetching.thenParsing(parser) syntax (which previously delegated to Loading.by(fetching)(parser)). We don't need two syntaxes for doing the same thing, and the fetching.thenParsing(parser) syntax seems more convenient. I definitely didn't want to have the 2x2 matrix of methods covering with/without-key * located-on-Loading/Fetching.

gu-scala-library-release bot added a commit that referenced this pull request Sep 3, 2025
…5.0c1dbdea published by rtyley

rtyley published release version 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-03T1555.0c1dbdea
using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow

Release-Version: 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-03T1555.0c1dbdea
Release-Initiated-By: https://github.com/rtyley
Release-Workflow-Run: https://github.com/guardian/etag-caching/actions/runs/17439005303
Release-Notes: #110
@gu-scala-library-release
Copy link
Contributor

@rtyley has published a preview version of this PR with release workflow run #242, based on commit 0c1dbde:

11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-03T1555.0c1dbdea

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the support-fetching-then-parsing-with-key branch, or use the GitHub CLI command:

gh workflow run release.yml --ref support-fetching-then-parsing-with-key

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch from 0c1dbde to 32fe2e2 Compare September 4, 2025 15:43
@rtyley rtyley changed the base branch from main to rearrange-executioncontexts September 4, 2025 15:43
gu-scala-library-release bot added a commit that referenced this pull request Sep 4, 2025
…4.32fe2e20 published by rtyley

rtyley published release version 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-04T1544.32fe2e20
using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow

Release-Version: 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-04T1544.32fe2e20
Release-Initiated-By: https://github.com/rtyley
Release-Workflow-Run: https://github.com/guardian/etag-caching/actions/runs/17469345493
Release-Notes: #110
@gu-scala-library-release
Copy link
Contributor

@rtyley has published a preview version of this PR with release workflow run #244, based on commit 32fe2e2:

11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-04T1544.32fe2e20

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the support-fetching-then-parsing-with-key branch, or use the GitHub CLI command:

gh workflow run release.yml --ref support-fetching-then-parsing-with-key

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

gu-scala-library-release bot added a commit that referenced this pull request Sep 4, 2025
…0.32fe2e20 published by rtyley

rtyley published release version 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-04T2020.32fe2e20
using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow

Release-Version: 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-04T2020.32fe2e20
Release-Initiated-By: https://github.com/rtyley
Release-Workflow-Run: https://github.com/guardian/etag-caching/actions/runs/17475700288
Release-Notes: #110
@gu-scala-library-release
Copy link
Contributor

@rtyley has published a preview version of this PR with release workflow run #245, based on commit 32fe2e2:

11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-04T2020.32fe2e20

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the support-fetching-then-parsing-with-key branch, or use the GitHub CLI command:

gh workflow run release.yml --ref support-fetching-then-parsing-with-key

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

@rtyley rtyley force-pushed the rearrange-executioncontexts branch from 7e930c6 to 99bd01e Compare September 9, 2025 09:19
@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch from 32fe2e2 to 3b4c706 Compare September 9, 2025 09:19
gu-scala-library-release bot added a commit that referenced this pull request Sep 9, 2025
…3.3b4c7060 published by rtyley

rtyley published release version 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-09T0923.3b4c7060
using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow

Release-Version: 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-09T0923.3b4c7060
Release-Initiated-By: https://github.com/rtyley
Release-Workflow-Run: https://github.com/guardian/etag-caching/actions/runs/17578030467
Release-Notes: #110
@gu-scala-library-release
Copy link
Contributor

@rtyley has published a preview version of this PR with release workflow run #248, based on commit 3b4c706:

11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-09-09T0923.3b4c7060

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the support-fetching-then-parsing-with-key branch, or use the GitHub CLI command:

gh workflow run release.yml --ref support-fetching-then-parsing-with-key

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

@rtyley rtyley force-pushed the rearrange-executioncontexts branch 2 times, most recently from 98f5f71 to e75cbd5 Compare October 8, 2025 09:59
Base automatically changed from rearrange-executioncontexts to main October 8, 2025 15:32
@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch 2 times, most recently from 70d2211 to 9a84353 Compare October 8, 2025 15:51
@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch 4 times, most recently from 9c9ee97 to e50fc02 Compare October 10, 2025 09:43
@rtyley rtyley changed the base branch from main to improve-testing October 10, 2025 09:43
@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch 3 times, most recently from 7469c06 to fe41f56 Compare October 10, 2025 16:10
@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch from fe41f56 to 639c6ec Compare October 10, 2025 16:47
# Conflicts:
#	core/src/test/scala/com/gu/etagcaching/LoadingTest.scala
@rtyley rtyley force-pushed the support-fetching-then-parsing-with-key branch from 639c6ec to abf81f8 Compare October 10, 2025 17:06
gu-scala-library-release bot added a commit that referenced this pull request Oct 10, 2025
…9.abf81f84 published by rtyley

rtyley published release version 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-10-10T2129.abf81f84
using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow

Release-Version: 11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-10-10T2129.abf81f84
Release-Initiated-By: https://github.com/rtyley
Release-Workflow-Run: https://github.com/guardian/etag-caching/actions/runs/18418888067
Release-Notes: #110
@gu-scala-library-release
Copy link
Contributor

@rtyley has published a preview version of this PR with release workflow run #251, based on commit abf81f8:

11.0.0-PREVIEW.support-fetching-then-parsing-with-key.2025-10-10T2129.abf81f84

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the support-fetching-then-parsing-with-key branch, or use the GitHub CLI command:

gh workflow run release.yml --ref support-fetching-then-parsing-with-key

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

@rtyley rtyley marked this pull request as ready for review October 13, 2025 08:39
@rtyley rtyley requested a review from a team as a code owner October 13, 2025 08:39
Base automatically changed from improve-testing to main October 15, 2025 15:27
@rtyley rtyley merged commit a31aa96 into main Oct 15, 2025
8 checks passed
@rtyley rtyley deleted the support-fetching-then-parsing-with-key branch October 15, 2025 15:39
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.

2 participants