| #!/bin/sh |
| |
| set -o nounset |
| |
| # Copyright 2018-2020 Fairphone B.V. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| LOGFILE=$1 |
| |
| printHeading() { |
| echo "h3. $1" |
| } |
| |
| countPrintStat() { |
| echo -n "* *$(grep "$1" "${LOGFILE}" | wc -l)*" |
| echo " $2" |
| } |
| |
| printHeading "Stats" |
| countPrintStat "INFO: Currently pointing to the integration branch." \ |
| "projects are on the integration branch" |
| countPrintStat "INFO: Currently pointing to the staging branch." \ |
| "projects are still on the staging branch" |
| countPrintStat "INFO: Pointing to the CAF ref." \ |
| "projects pointing to CAF" |
| countPrintStat "AOSP. Still trying to merge…" \ |
| "projects are not pointing to AOSP." |
| countPrintStat "INFO: Currently pointing to the AOSP-Partner ref. (which is also the AOSP ref." \ |
| "projects are already pointing to the target reference" |
| countPrintStat "INFO: Could fast-forward to the AOSP-Partner ref., but will still create a merge commit." \ |
| "projects could be fast-forwarded to the target reference" |
| countPrintStat "WARNING: Continuing on top of local commits. Using REPO_RREV=" \ |
| "projects seem to have local commits that are not merged on the remote." |
| echo "" |
| |
| printHeading "Ignored and faulty Projects" |
| countPrintStat "ERROR: Cannot find the latest AOSP ref. (" \ |
| "projects are missing the AOSP reference tag." |
| countPrintStat "does not exist on remote, ignoring project." \ |
| "project where partner remote could not be found" |
| countPrintStat "ERROR: Aborting as we are not on a known branch and ALLOW_LOCAL_COMMITS is not enabled." \ |
| "projects pointing outside of integration, staging or CAF and ALLOW_LOCAL_COMMITS is not enabled." |
| countPrintStat "WARNING: Shallow checkout, could not check if we merged the AOSP-Partner ref." \ |
| "project with shallow checkouts where we can't check their state." |
| echo "" |
| |
| printHeading "Projects with merges" |
| countPrintStat "INFO: Successfully merged the AOSP-Partner ref." \ |
| "projects with successful merges in total." |
| countPrintStat "ERROR: Merge was successful but we are not on a branch. This merge needs to be pushed!" \ |
| "projects were merged without conflict but are not on a branch." |
| countPrintStat "WARNING: Merge was successful but we are not on a branch! However, the merge is empty so can be ignored." \ |
| "projects that are not on a branch have an empty merge. (safe to ignore)" |
| countPrintStat "INFO: Pushing for review…" \ |
| "projects were merged without conflict and can be pushed for review." |
| countPrintStat "ERROR: Could not push the merged HEAD to the remote" \ |
| "projects where pushing to Gerrit failed." |
| echo "" |
| |
| printHeading "Merge conflicts" |
| countPrintStat "ERROR: Could not merge the AOSP-Partner ref." \ |
| "projects with merge conflicts" |