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

Simplify CI #429

Merged
merged 2 commits into from
Jun 29, 2023
Merged

Simplify CI #429

merged 2 commits into from
Jun 29, 2023

Conversation

ZacSweers
Copy link
Collaborator

We don't really ever set other versions and having a consistent name is required in order to mark those checks as required for merge queue

We don't really ever set other versions and having a consistent name is required in order to mark those checks as `required` for merge queue
@github-actions
Copy link

Overall, the code looks good. Here are some suggestions for improvement:

  1. In the ci.yml file, instead of hardcoding the JDK version, you can read it from the gradle/libs.versions.toml file using the grep command. Here's an example:

    - uses: actions/setup-java@v3
    + uses: actions/setup-java@v3
    + with:
    +   java-version: ${{ env.JDK_VERSION }}
  2. In the code-review.yml file, you can remove the types field from the pull_request event. By default, the pull_request event triggers on opened, reopened, synchronize, and ready_for_review events.

  3. In the bootstrap.md file, add a description of what the Bootstrap tool does and how it is used in the repo-specific setups. Provide an example of how to use the Bootstrap tool in a bash script.

  4. In the dependency-rake.md file, add a description of what the Dependency Rake tool does and how it is used with the DAGP plugin. Describe the three main categories of fixes that the tool applies and provide examples for each category.

  5. In the dsl.md file, add a description of what the DSL extension does and how it is used to configure project behavior. Provide examples of how to use the DSL extension to configure features like Dagger, Moshi, and Robolectric.

  6. In the utilities.md file, add a description of each utility and how it is used in the project. Provide examples of how to use each utility.

  7. In the GlobalConfig.kt file, instead of using the register function to create the UpdateRobolectricJarsTask, you can use the tasks.register function directly. Here's an example:

    tasks.register<UpdateRobolectricJarsTask>("updateRobolectricJars") {
        // Configure the task properties
    }
  8. In the Sdk.kt file, remove the dependencyCoordinates property as it is not used.

  9. In the UpdateRobolectricJarsTask.kt file, use the okhttp library to download the Robolectric jars instead of copying them from the local filesystem. This will allow you to handle network errors and provide more control over the download process. Here's an example of how to use okhttp to download a file:

    val client = OkHttpClient()
    val request = Request.Builder()
        .url("https://example.com/file.jar")
        .build()
    val response = client.newCall(request).execute()
    val inputStream = response.body()?.byteStream()
    val outputFile = File("output.jar")
    outputFile.outputStream().use { outputStream ->
        inputStream?.copyTo(outputStream)
    }
  10. In the UpdateRobolectricJarsTask.kt file, use the workerExecutor to perform the download task in the background. This will improve the performance and scalability of the task. Here's an example of how to use the workerExecutor:

    @Inject
    constructor(
        private val workerExecutor: WorkerExecutor,
        // Other task properties
    ) : DefaultTask(), BootstrapTask {
    
        @TaskAction
        fun download() {
            val workQueue = workerExecutor.noIsolation()
            // Add work items to the work queue
            workQueue.await()
        }
    }

These are just some suggestions for improvement. Feel free to adapt them to your specific use case and coding style.

strategy:
fail-fast: false
matrix:
ci_java_version: ['20']
Copy link
Contributor

Choose a reason for hiding this comment

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

matrix.ci_java_version is still being used in 2 locations. Can you please resolve those references as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch 07f36eb

@github-actions
Copy link

Here are the changes I would suggest to improve the code:

  1. In the .github/workflows/ci.yml file:

    • Remove the unused environment variables DEP_OVERRIDES, DEP_OVERRIDE_KOTLIN, DEP_OVERRIDE_AGP, and DEP_OVERRIDE_JAVA.
    • Remove the unused name field in the build job.
    • Remove the unused strategy field in the build job.
    • Update the Install JDK step to use the env.JDK_VERSION variable directly instead of ${{ matrix.ci_java_version }}.
    • Update the Install JDK step to use single quotes for the java-version value: '${{ env.JDK_VERSION }}'.
    • Update the Install JDK step to use the env.JDK_VERSION variable directly instead of '20'.
    • Update the Install JDK step to use single quotes for the java-version value: '${{ env.JDK_VERSION }}'.
  2. In the .github/workflows/code-review.yml file:

    • Remove the unused on field.
  3. In the bootstrap.md file:

    • Remove the entire content of the file and replace it with TODO.
  4. In the dependency-rake.md file:

    • Remove the entire content of the file and replace it with TODO.
  5. In the dsl.md file:

    • Remove the entire content of the file and replace it with TODO.
  6. In the utilities.md file:

    • Remove the entire content of the file and replace it with TODO.
  7. In the mkdocs.yml file:

    • Remove the unused sections from the nav configuration.
  8. In the GlobalConfig.kt file:

    • Remove the unused import statements.
    • Remove the unused JvmVendorSpec import.
    • Remove the unused JvmVendorSpec parameter from the applyJvmVendor function.
    • Remove the unused JvmVendorSpec parameter from the applyJvmVendor function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused JvmVendorSpec parameter from the configureBootstrap function call in the configureBootstrap function.
    • Remove the unused `JvmVendor

@ZacSweers ZacSweers added this pull request to the merge queue Jun 29, 2023
Merged via the queue into main with commit c249d08 Jun 29, 2023
@ZacSweers ZacSweers deleted the z/ciUpdates branch June 29, 2023 21:05
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