aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-03Merge "hooks: bpfmt: display formatting diff on errors" into main am: 2976a4d245HEADub-automotive-master-20240314mastermainTreehugger Robot
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621057 Change-Id: I86ab7851460c8499a38a513df1cbb9131172d67f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-03Merge "hooks: bpfmt: display formatting diff on errors" into mainub-automotive-master-20240125androidx-test-uiautomator-releaseandroidx-graphics-releaseTreehugger Robot
2023-09-27pre-upload: fix internal_failure setting am: 99cf377b6dMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2744953 Change-Id: Icc891c4b1a88baffc6a4aa5194033b41c0e66b09 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06pre-upload: fix internal_failure settingub-automotive-master-20231102ub-automotive-master-20231011android-vts-14.0_r2android-cts-14.0_r2androidx-wear-wear-tooling-preview-releaseandroidx-core-performance-releaseMike Frysinger
This is a named tuple, so we need to replace the value, not set it. Bug: 299373007 Test: None Change-Id: I86eb65c484878c11c2f02b6a0c6212943895f922
2023-08-17Merge "results: filter out warnings from the "is an error" check" into main ↵android14-gsiMike Frysinger
am: 904ef56283 Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2713953 Change-Id: Iaf5f1859d0e6a581d47a9aea9b2b793eedd94b1d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-17Merge "results: filter out warnings from the "is an error" check" into mainMike Frysinger
2023-08-16results: filter out warnings from the "is an error" checkMike Frysinger
Stop treating warnings as errors, and fix the reporting to run if the result is a warning or an error. Bug: 294133100 Test: unittests Change-Id: Ic238b910a215ae5ec7c7c590299b2403b77c99d5
2023-07-16Merge "check_commit_msg_relnote_field_format: Fix indent on commit message" ↵Treehugger Robot
into main am: ed904c8a33 Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2651170 Change-Id: I6a9b36bcc5dbdbc32c8644e7caa4d9187e53f4d6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-16Merge "check_commit_msg_relnote_field_format: Fix indent on commit message" ↵androidx-platform-releaseTreehugger Robot
into main
2023-07-14check_commit_msg_relnote_field_format: Fix indent on commit messageNatnael Belay
The indent of the example message printed for a multiline commit is misleading. Simply following the error message would cause `repo upload` to fail since the subsequent lines are not indented. Bug: 290051295 Change-Id: I613b4b51f6ff3a4ab3cde034362344519341abf9
2023-07-12Merge "pre-upload: Ask user confirmation even for 1 hook" into main am: ↵Treehugger Robot
6131d44085 Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2654201 Change-Id: If2a6dcb0563f32d51ca79791b1e4d22ef6b9952b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-12Merge "pre-upload: Ask user confirmation even for 1 hook" into mainTreehugger Robot
2023-07-12aidl_format: Fix `aidl_api` directory exception for aidl_format hook am: ↵Devin Moore
c13f6bfa45 Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2654235 Change-Id: I64fde7f799265df3c702867032d89f9b2cf45c58 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-12aidl_format: Fix `aidl_api` directory exception for aidl_format hookDevin Moore
It wasn't matching files correctly when the `aidl_api` directory was at the base of the git repository. In those cases the file name shows up as `aidl_api/path/to/files` and doesn't have the path separator in front of `aidl_api/`. Test: upload aosp/2653183 Bug: None Change-Id: Id87a0111f76a46c8cc84a3af57d3cb1deeb54814
2023-07-12pre-upload: Ask user confirmation even for 1 hookWilliam Escande
By defaulting mode to 'some', the user will have a prompt confirmation before the hook being run. Currently it is run silently by default Bug: None Test: upload change with single hook to run Change-Id: Iacb7cb2b9b5d571ef10e61891545ceebfcf68a8e
2023-07-06pre-upload: allow user to run any/all of the fixups am: 338af8dedeMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621055 Change-Id: I987c446c1533f85d38d5fb39cbb50f0e7d929853 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06pre-upload: show all possible fixup commands while running am: 1739927ab8Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621054 Change-Id: I67c487401791efb38013fc29d3c2d0290d04f4d1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-23pre-upload: allow user to run any/all of the fixupsMike Frysinger
Now that we accumulate & return all the hook results for all projects, we can easily summarize & prompt the user whether they want to run any or all of them. We still have the problem of some fixups might clash (e.g. if multiple commits introduce multiple errors), but there can be scenarios where the fixups don't clash. We leave this decision to the user so they can figure out what makes sense for their setup. Bug: 274529930 Test: unittests Change-Id: Ib6a42cf4fdb0165d9cae779cef7599ef604fbf59
2023-06-23hooks: bpfmt: display formatting diff on errorsMike Frysinger
`bpfmt -l` just shows "<standard input>" when there's a formatting error which isn't super useful to users. Switch to `bpfmt -d` to get an actual diff of broken formatting. Also hoist the definition of fixup_cmd outside the loop since it doesn't change between runs anymore -- the set of files is passed via the results object now. Bug: 132785638 Test: unittests Change-Id: I9d564ac4b7fd3801b73b5c6869a2529f337cc3f0
2023-06-23pre-upload: show all possible fixup commands while runningandroidx-wear-platform-releaseMike Frysinger
This allows people to quickly run fixup commands themselves if they want. This is helpful as we only offer to run the command if there is one fixup in the latest commit. Show these as a summary at the end so hopefully it's a little easier for users to access if they want to copy & paste the command. Bug: 274529930 Test: unittests Change-Id: I75b9c196a5369874fac94e822ec87e72f804cb9a
2023-06-24pre-upload: run hooks in parallel using futures am: c400921fdaMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2636770 Change-Id: I33b276034c7e33bbe697fe11453ef93814c55666 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-24pre-upload: flip hook progress output style am: 4473f01713Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2636769 Change-Id: I7a7a70192e5f2fa414d92352dceb03ff45d7ef55 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-23pre-upload: hoist exclusion logic earlier am: 1fc51c305bMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2634960 Change-Id: Iab5aefda34830c12b96b547c21b1edae31fd2e88 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-23pre-upload: run hooks in parallel using futuresMike Frysinger
Run all the hooks in parallel using Python futures. In the repohooks tree with 12 commits, this cuts execution time from ~51 to ~31 secs. In the libbrillo tree with 1 commit, it's still faster by a few 10's of msec. So this doesn't seem like it negatively impacts even small sets of commits, while larger chains are a huge improvement. Bug: None Test: `./pre-upload.py` works and is faster Change-Id: I347e5bdcd6206a768219769c51a6ddbaefefa44e
2023-06-23pre-upload: flip hook progress output styleMike Frysinger
Currently the hook status line shows how many hooks have been run, and what the current hook being executed is. This is fine for a single-threaded model, but is confusing if we want to run hooks in parallel. So flip the status to show all the running and pending hooks. This is a bit more verbose, but it's the only way to really represent the work that is being done. In practice, many of the hooks are very fast, so the long line will collapse very quickly to something more manageable. If the line is too long for the current terminal, we will chop it. Old: [RUNNING 2/13] hooks_unittest New: [RUNNING 4/13] shell_unittest, config_unittest, utils_unittest, ... Bug: None Test: `./pre-upload.py` output Change-Id: I280682c93ae4164adf210ba5d4a54867af377e85
2023-06-22Merge "hooks: gofmt: fix argument handling" am: e2a519ed6fandroid14-devTreehugger Robot
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621058 Change-Id: I31c85fa5481a304bd4554405e934ddaaba0692b8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-22hooks: rustfmt: drop custom format suggestion am: b1f4a748aeMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621056 Change-Id: If9aebb9652fa531f05aa5a5fd753eb3c6ed7311c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-22pre-upload: hoist exclusion logic earlierMike Frysinger
Filter the set of hooks as soon as we have all the info we need. If all the hooks are filtered, we can exit sooner. Otherwise, present a more accurate summary to users as to how many hooks we'll actually be running. Since we no longer need the scope in the main loop, switch to processing the NamedTuple directly so we don't have to unpack every field in it. Bug: 160223496 Test: unittests Change-Id: I63d65a9034a6d4ca6d70b158ceab7c6f5861f326
2023-06-22Merge "hooks: gofmt: fix argument handling"Treehugger Robot
2023-06-22hooks: gofmt: fix argument handlingMike Frysinger
Since gofmt iterates over the filtered set of files by hand, and reads it from the git commit to run through the formatter, we don't want to expand the list of files into the base command. If they end up there, gofmt will run on them as they exist on disk, not on the content as they exist in the git commit. Also make sure to pass the set of custom gofmt arguments to the fixup command so it gets run correctly. Bug: 116112526 Test: unittests Change-Id: I3615afa97817482c4e0482053fa308bed8c8d12b
2023-06-22hooks: rustfmt: drop custom format suggestionMike Frysinger
Rely on the common framework to display & run fixup commands. Bug: None Test: unittests Change-Id: I1242e0a9cf4bc160b0e20aed1bf16d606aa3ddc9
2023-06-19results: refactor return values to include the full set of results am: ↵Mike Frysinger
e7cbdee817 Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621052 Change-Id: I9b1535a413ef7aa21c49cdcf879bd7db19318252 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15utils: handle signal errors with threads am: c4291c3fb7Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621729 Change-Id: I2fe971a4fe53c58a3ed04a88903e24261bcc6b66 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15results: refactor return values to include the full set of resultsub-automotive-master-20230622Mike Frysinger
Rather than normalize everything into a bool early on, and then make it hard to keep track of results across projects, and force creation of a parallel structure to hold fixup commands, create a new results object to hold everything and pass that back up the chain. For now, this is just restructuring, and upload continues to behave the same. But this will make it much easier to change the UX. Bug: None Test: unittests Change-Id: Idfa545f02f3d26a893d6cbbdef6d9a2409e72813
2023-06-11Merge "pre-upload: handle Ctrl+C when running directly" am: e669af6414Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2617576 Change-Id: I203bee471f75c44ce1450599614920e72f1ccf1c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-10utils: handle signal errors with threadsMike Frysinger
We might not be able to rebind signals if we're running in a thread, so ignore ValueError when setting the handler. Bug: None Test: unittests Change-Id: I81a222bf00ff433c8570bb7058871817f15da003
2023-06-11Merge "pre-upload: handle Ctrl+C when running directly"Treehugger Robot
2023-06-11hooks: ktfmt: drop custom format suggestion am: 13285896d0Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621053 Change-Id: Icba5c60d20d61378123fce930eb0ad1e0c395b7d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-11pre-upload: add progress counter for commits too am: 5c139d804bMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2617316 Change-Id: I96f7947692b5be53191b5f90f90527befa10ec80 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-10hooks: ktfmt: drop custom format suggestionMike Frysinger
Rely on the common framework to display & run fixup commands. Bug: None Test: unittests Change-Id: Id3714df6b6c5c2654cf43cff78fb8226e4ec3629
2023-06-10pre-upload: handle Ctrl+C when running directlyMike Frysinger
Exit gracefully when the user interrupts us with direct execution. Bug: None Test: `./pre-upload.py` and then Ctrl+C Change-Id: I43f0938e8f46d37048cfd8f8c050d0b8499538c1
2023-06-10fixups: store command rather than callback in results am: 9cf5981041Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2617658 Change-Id: I51a706d309d8b2666bc2508c891eb286e94bb84a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-10pre-upload: unify multi-project iteration am: 65711e5e84Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2621051 Change-Id: I919534aa3db89e2290698d62e072a17be44f2648 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-10pre-upload: fix exclusion hook logic am: 9c8a021103Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2620900 Change-Id: I6938084663f4a5e4559b0e8aac500d4ce729c482 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09pre-upload: add progress counter for commits tooMike Frysinger
When uploading multiple commits, it can be nice to see how many there are left to go. Bug: None Test: unittests Change-Id: I2e9c84eabd5c364a4ac87a6d862678263d62b3da
2023-06-10fixups: store command rather than callback in resultsMike Frysinger
All of the fixup funcs just run an external command. This makes it difficult to harmonize output, and leads to duplicated logic. Switch to storing the fixup command that would be run. This doesn't change any behavior currently, just refactoring to make it easier to make followup changes. Bug: None Test: unittests Change-Id: Ib9e56bc46116997862b25362c49a617326b8909b
2023-06-10pre-upload: unify multi-project iterationMike Frysinger
This will make it easier to add common behavior after we've processed all projects regardless of how many there are. Bug: None Test: unittests Change-Id: I890db0ed156eaa014a71aac813a1379465049041
2023-06-09pre-upload: fix up a few more lint errors that snuck in am: fb36fbd010Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2618674 Change-Id: I6aac87a02a787ea600bbe576d256f6cf5a13a650 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09pre-upload: fix & improve display of files am: d074a2949fMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2617656 Change-Id: I34f6c420c01516547da770648ed9e4f8ef187eed Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09pre-upload: include "hook" in the error summary am: dca21d9487Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2620897 Change-Id: I48b2af1abca9ad2e4caaf7815af1b63091bcdd23 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>