Rarasinhoo opened a new pull request, #11925:
URL: https://github.com/apache/nifi/pull/11925

   # Summary
   
   [NIFI-16588](https://issues.apache.org/jira/browse/NIFI-16588)
   
   `GitHubRepositoryClient` did not override `getLatestCommitSha(path, 
branch)`, so `AbstractGitFlowRegistryClient` fell back to listing commits: 
`getRef`, a page of commits and one author lookup per commit missing from the 
commit cache. With more than a thousand versioned Process Groups the 
1,000-entry cache does not hold, and each synchronization of a Process Group 
costs about 12 REST requests, enough to exhaust the 15,000 requests/hour of a 
GitHub App installation.
   
   The GitLab client already answers this with one request. This change does 
the same for GitHub through 
`queryCommits().path(path).from(branch).pageSize(1)`, which is `GET 
/repos/{owner}/{repo}/commits?path=…&sha=…&per_page=1`. `PagedIterator` wraps 
`IOException` in `GHException`; the cause is unwrapped, and a 
`FileNotFoundException` keeps the existing path-or-branch-not-found error.
   
   `GitHubRepositoryClientTest` covers the latest commit, a file with no 
commits, and a missing path or branch.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [x] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-00000`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-00000`
   - [x] Pull request contains [commits 
signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
 with a registered key indicating `Verified` status
   
   ### Pull Request Formatting
   
   - [x] Pull Request based on current revision of the `main` branch
   - [x] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [x] Build completed using `./mvnw clean install -P contrib-check` (on the 
changed module)
     - [x] JDK 21
     - [ ] JDK 25
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to