Netflix / Netflix/dgs-codegen

GenerateJavaTask is difficult for gradle to cache

Open
#513 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
217
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Hello!

My company is trying to optimize our gradle caching, and it looks like the DGS GenerateJavaTask is causing a bit of trouble. Specifically, the generateSourcesDir input is a String containing an absolute filepath, which seems to foil remote caching attempts (since repos are cloned to different locations on different machines). Gradle can cache paths well if they're annotated with @PathSensitive(PathSensitivity.RELATIVE), but I'm not sure whether that works on string properties.

I think that PR #356 would allow us to work around this; it'd let us assign specific values to the output dirs, so we could set generatedSourcesDir to some stable empty string and it'd stop busting the cache. Is that PR likely to be merged at some point?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with graphql-dgs-codegen-gradle/src/main/kotlin/com/netflix/graphql/dgs/codegen/gradle/GenerateJavaTask.kt, especially the generateSourcesDir input at line 34, and review PR #356 for the proposed direction. Determine how the absolute filepath affects Gradle remote caching and verify that the resulting task inputs and outputs remain cacheable across different checkout paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.