forked from GerritCodeReview/git-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
[WILD] CodeReviewer APPEARS #1
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
Open
adlai
wants to merge
84
commits into
orpheids-family:main
Choose a base branch
from
GerritCodeReview:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
d93fe60
sync: Handle KeyboardInterrupt during checkout
sokcevicG 41a27eb
gc: extract deletion from Execute method
sokcevicG 3405446
gc: Add repack option
sokcevicG db111d3
sync: Recover from errors during read-tree
sokcevicG 1711bc2
git_config: prefer XDG config location
747ec83
run_tests: update to python 3.11 & pytest 8.3.4
vapier dfdf577
docs: smart-sync: split out & expand details
vapier 5ae8292
Revert "sync: skip network half on repo upgrade"
sokcevicG cf9a2a2
Update internal filesystem layout for submodules
quic-kaushikl 66685f0
Use 'gitfile' in submodule checkouts
quic-kaushikl 99eca45
Activate submodules
quic-kaushikl 8d5f032
gc: Add tags to remote pack list
sokcevicG fc901b9
sync: Refresh index before updating repo
sokcevicG 4b94e77
Sync: Fix full submodule sync while shallow specified
243df20
launcher: change RunResult to subprocess.CompletedProcess
vapier 91f4280
run_tests: run all tests all the time
vapier d508739
run_tests: move CQ test skips here
vapier 8310436
run_tests: move test filtering to pytest markers
vapier cd391e7
black: update to v25
vapier 507d463
tox: sync black settings with run_tests
vapier 59b81c8
launcher: change collections.namedtuple to typing.NamedTuple
vapier dc8185f
launcher: change RunError to subprocess.CalledProcessError
vapier 9ecb80b
pager: drop unused global vars
vapier f070331
Fix EROFS error when root fs is mounted read-only
egor-duda 85ee173
run_tests: enable Python 3.8 CI coverage
vapier 3667de1
run_tests: fix running when cwd is not the root
vapier daebd6c
sync: Warn about excessive job counts
gavinmak 0214730
launcher: switch command quoting to shlex.quote
vapier 97dc5c1
project: use --netrc-optional instead of --netrc
gavinmak a94457d
Fallback to full sync when depth enabled fetch of a sha1 fails
quic-kaushikl c061593
manifest: Remove redundant re-raise of BaseExceptions
c8da28c
man: regenerate man pages
vapier 0f200bb
flake8: Ignore .venv directory
21cbcc5
update-manpages: include in unittests
vapier c448ba9
run_tests: only allow help2man skipping in CI
vapier 1acbc14
manifest: generalize --json as --format=<format>
vapier 8d37f61
upload: Add superproject identifier as push option
gavinmak 06338ab
subcmds: delete redundant dest= settings
vapier 3c8bae2
info: print superproject revision
08815ad
upload: Add rev to rootRepo push option
gavinmak 0cb88a8
git_superproject: Replace walrus operator
gavinmak 044e52e
hooks: add internal check for external hook API
vapier b262d0e
info: fix mismatched format args and wrong symbol name
8535282
sync: Add scaffolding for interleaved sync
gavinmak f91f446
upload: fix FileNotFoundError when no superproject
gavinmak b4b323a
sync: Add orchestration logic for --interleaved
gavinmak 7b6ffed
sync: Implement --interleaved sync worker
gavinmak 6b8e9fc
sync: clarify job flags when using interleaved
gavinmak f7a3f99
sync: Share self-update logic between sync modes
gavinmak df3c401
sync: Share manifest list update logic between sync modes
gavinmak 99b5a17
sync: Share final error handling logic between sync modes
gavinmak 21269c3
init: Add environment variable for git-lfs
82d500e
sync: support post-sync hook in <repo-hooks>
Chao-Shun-Cheng 5d95ba8
progress: Make end() idempotent
gavinmak 74edacd
project: Use plumbing commands to manage HEAD
gavinmak 2e6d088
sync: Improve UI and error reporting for interleaved mode
gavinmak 52bab0b
project: Use git rev-parse to read HEAD
gavinmak 25858c8
sync: Default to interleaved mode
gavinmak 720bd1e
sync: Don't checkout if no worktree
gavinmak 7f7d70e
project: Fix GetHead to handle detached HEADs
gavinmak d3eec0a
sync: fix connection error on macOS for interleaved sync
kcwu 239fad7
hooks: verify hooks project has worktree before running
gavinmak 8c3585f
project: fallback to reading HEAD when rev-parse fails
gavinmak d9cc0a1
Fix shallow clones when upstream attribute is present
kwesolowski-at-volvocars 380bf95
sync: always show sync result stderr_text on error
gavinmak a6e1a59
sync: Avoid duplicate projects in error text
gavinmak 3e6acf2
progress: Fix race condition causing fileno crash
gavinmak a64149a
sync: Record and propagate errors from deferred actions
gavinmak d534a55
sync: Fix missing error details in interleaved summary
gavinmak 854fe44
git_superproject: fix AttributeError in Superproject logging
gavinmak 38d2fe1
Revert "Fix shallow clones when upstream attribute is present"
gavinmak 58a59fd
CONTRIBUTING: rename doc per Google OSS policies
vapier 5ed12ec
standardize file header wrt licensing
vapier c615c96
man: regen after sync updates
vapier 80d1a5a
run_tests: add file header checker for licensing blocks
vapier d30414b
forall: fix crash with no command
vapier 67383bd
Follow up "Fix shallow clones when upstream attribute is present"
quic-kaushikl 4623264
Fix submodule initialization in interleaved sync mode
quic-kaushikl e4872ac
sync: Use 'git rebase' during 'repo sync --rebase'
2719a8e
run_tests: log each command run
vapier 1afe96a
sync: fix saving of fetch times and local state
gavinmak 4ab2284
manifest: Make extend-project support copyfile, linkfile and annotation
877ef91
man: Regenerate after manifest update
5998c0b
tests: manifest_xml: convert most path usage to pathlib
vapier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # repo Smart Syncing | ||
|
|
||
| Repo normally fetches & syncs manifests from the same URL specified during | ||
| `repo init`, and that often fetches the latest revisions of all projects in | ||
| the manifest. This flow works well for tracking and developing with the | ||
| latest code, but often it's desirable to sync to other points. For example, | ||
| to get a local build matching a specific release or build to reproduce bugs | ||
| reported by other people. | ||
|
|
||
| Repo's sync subcommand has support for fetching manifests from a server over | ||
| an XML-RPC connection. The local configuration and network API are defined by | ||
| repo, but individual projects have to host their own server for the client to | ||
| communicate with. | ||
|
|
||
| This process is called "smart syncing" -- instead of blindly fetching the latest | ||
| revision of all projects and getting an unknown state to develop against, the | ||
| client passes a request to the server and is given a matching manifest that | ||
| typically specifies specific commits for every project to fetch a known source | ||
| state. | ||
|
|
||
| [TOC] | ||
|
|
||
| ## Manifest Configuration | ||
|
|
||
| The manifest specifies the server to communicate with via the | ||
| the [`<manifest-server>` element](manifest-format.md#Element-manifest_server) | ||
| element. This is how the client knows what service to talk to. | ||
|
|
||
| ```xml | ||
| <manifest-server url="https://example.com/your/manifest/server/url" /> | ||
| ``` | ||
|
|
||
| If the URL starts with `persistent-`, then the | ||
| [`git-remote-persistent-https` helper](https://github.com/git/git/blob/HEAD/contrib/persistent-https/README) | ||
| is used to communicate with the server. | ||
|
|
||
| ## Credentials | ||
|
|
||
| Credentials may be specified directly in typical `username:password` | ||
| [URI syntax](https://en.wikipedia.org/wiki/URI#Syntax) in the | ||
| `<manifest-server>` element directly in the manifest. | ||
|
|
||
| If they are not specified, `repo sync` has `--manifest-server-username=USERNAME` | ||
| and `--manifest-server-password=PASSWORD` options. | ||
|
|
||
| If those are not used, then repo will look up the host in your | ||
| [`~/.netrc`](https://docs.python.org/3/library/netrc.html) database. | ||
|
|
||
| When making the connection, cookies matching the host are automatically loaded | ||
| from the cookiejar specified in | ||
| [Git's `http.cookiefile` setting](https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpcookieFile). | ||
|
|
||
| ## Manifest Server | ||
|
|
||
| Unfortunately, there are no public reference implementations. Google has an | ||
| internal one for Android, but it is written using Google's internal systems, | ||
| so wouldn't be that helpful as a reference. | ||
|
|
||
| That said, the XML-RPC API is pretty simple, so any standard XML-RPC server | ||
| example would do. Google's internal server uses Python's | ||
| [xmlrpc.server.SimpleXMLRPCDispatcher](https://docs.python.org/3/library/xmlrpc.server.html). | ||
|
|
||
| ## Network API | ||
|
|
||
| The manifest server should implement the following RPC methods. | ||
|
|
||
| ### GetApprovedManifest | ||
|
|
||
| > `GetApprovedManifest(branch: str, target: Optional[str]) -> str` | ||
|
|
||
| The meaning of `branch` and `target` is not strictly defined. The server may | ||
| interpret them however it wants. The recommended interpretation is that the | ||
| `branch` matches the manifest branch, and `target` is an identifier for your | ||
| project that matches something users would build. | ||
|
|
||
| See the client section below for how repo typically generates these values. | ||
|
|
||
| The server will return a manifest or an error. If it's an error, repo will | ||
| show the output directly to the user to provide a limited feedback channel. | ||
|
|
||
| If the user's request is ambiguous and could match multiple manifests, the | ||
| server has to decide whether to pick one automatically (and silently such that | ||
| the user won't know there were multiple matches), or return an error and force | ||
| the user to be more specific. | ||
|
|
||
| ### GetManifest | ||
|
|
||
| > `GetManifest(tag: str) -> str` | ||
|
|
||
| The meaning of `tag` is not strictly defined. Projects are encouraged to use | ||
| a system where the tag matches a unique source state. | ||
|
|
||
| See the client section below for how repo typically generates these values. | ||
|
|
||
| The server will return a manifest or an error. If it's an error, repo will | ||
| show the output directly to the user to provide a limited feedback channel. | ||
|
|
||
| If the user's request is ambiguous and could match multiple manifests, the | ||
| server has to decide whether to pick one automatically (and silently such that | ||
| the user won't know there were multiple matches), or return an error and force | ||
| the user to be more specific. | ||
|
|
||
| ## Client Options | ||
|
|
||
| Once repo has successfully downloaded the manifest from the server, it saves a | ||
| copy into `.repo/manifests/smart_sync_override.xml` so users can examine it. | ||
| The next time `repo sync` is run, this file is automatically replaced or removed | ||
| based on the current set of options. | ||
|
|
||
| ### --smart-sync | ||
|
|
||
| Repo will call `GetApprovedManifest(branch[, target])`. | ||
|
|
||
| The `branch` is determined by the current manifest branch as specified by | ||
| `--manifest-branch=BRANCH` when running `repo init`. | ||
|
|
||
| The `target` is defined by environment variables in the order below. If none | ||
| of them match, then `target` is omitted. These variables were decided as they | ||
| match the settings Android build environments automatically setup. | ||
|
|
||
| 1. `${SYNC_TARGET}`: If defined, the value is used directly. | ||
| 2. `${TARGET_PRODUCT}-${TARGET_RELEASE}-${TARGET_BUILD_VARIANT}`: If these | ||
| variables are all defined, then they are merged with `-` and used. | ||
| 3. `${TARGET_PRODUCT}-${TARGET_BUILD_VARIANT}`: If these variables are all | ||
| defined, then they are merged with `-` and used. | ||
|
|
||
| ### --smart-tag=TAG | ||
|
|
||
| Repo will call `GetManifest(TAG)`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of these file-handling routines seem a little fragile to me, although it might be the compromises necessary for cross-platform support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CAUTION
LINT IS FLAMMABLE