Version 15 vs 20
Version 15 vs 20
Edits
Edits
- Edit by kuba-orlik, Version 20
- Feb 29 2024 18:30
- Edit by kuba-orlik, Version 15
- Oct 30 2023 14:08
Edit Older Version 15... | Edit Current Version 20... |
Content Changes
Content Changes
# Arcanist
Arcanist is a CLI tool that helps you submit your code changes for code review. You can use it to
* create, submit and update diffs (`arc diff`);
* land the changes after they've been reviewed (`arc land` - this equivalent to a "Merge");
* run unit tests and check code coverage (`arc lint`, `arc unit`)
## Instalacja
See this link for an installation guide: https://hub.sealcode.org/w/sealhub_workflow/linting/
## Konfiguracja
Wykonaj polecenie
```
# arc install-certificate https://hub.sealcode.org/
```
i podążaj za instrukcjami. Jest to jednorazowy krok mający na celu uwierzytelnienie Arcanista na Twojej maszynie w danym repozytorium lokalnym.
## Wybór domyślnego edytora
Arcanist korzysta z domyślnego edytora, aby umożliwić konfigurację diffów (wliczając w to tytuły diffów i listę recenzentów). Aby wybrać domyślny edytor, ustaw odpowiednio zmienną środowiskową `$EDITOR` (prawdopodobnie możesz to zrobić w Twoim pliku `~/.bashrc`, w przypadku systemu OSX w pliku `~/.bash_profile`).
## Korzystanie z Arcanista
Arcanist jest wymagany do pracy w Review Workflow. W [dokumencie opisującym workflow](https://hub.sealcode.org/w/sealhub_workflow/audyt-i-review/review-workflow/) można przeczytać więcej o tym, jak korzystać z Arcanista.
## Kilka review naraz
Może zdarzyć się, że wyślesz zmiany na review i pozostaje Ci czekać, aż ktoś je zrecenzuje. W międzyczasie możesz oczywiście pracować nad innym diffem! Załóż nowego brancha, który ma zwój korzeń w `master`ze, wykonaj kilka commitów i ponownie możesz założyć nowy review request za pomocą polecenia `arc diff`.
-----
## Rozwiązywanie problemów
### Error: `"Arc was unable to automagically make a name for this patch"`
Jeżeli po kilkukrotnym odpaleniu `arc patch` na tego samego diff arc krzyczy:
```
name="arc patch"
Branch name arcpatch-D300 already exists; trying a new name.
Branch name arcpatch-D300_1 already exists; trying a new name.
Branch name arcpatch-D300_2 already exists; trying a new name.
Branch name arcpatch-D300_3 already exists; trying a new name.
Exception
Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again.
(Run with `--trace` for a full exception trace.)
```
Oznacza to, że wyczerpały się nazwy branchy, pod którymi trzymane są poprzednie patche tego samego diffa.
```
name="git branch"
* alpha
arcpatch-D187
arcpatch-D188
arcpatch-D196
arcpatch-D213_1
arcpatch-D213_2
arcpatch-D217
arcpatch-D300_1
arcpatch-D300_2
arcpatch-D300_3
...
```
Jeżeli nie potrzebujesz już żadnych poprzednich lokalnych branchy w postaci `arcpatch-D...`, możesz je usunąć poleceniem:
```
# git branch | cut -c3- | grep arcpatch- | xargs -n1 git branch -D
```
Więcej o rozwiązaniu tego problemu możesz przeczytać tutaj: https://secure.phabricator.com/T3277#33729
### Exception: Source file ".pinterest-linters/__phutil_library_init__.php" failed to load.
Rozwiązania:
1. Sklonuj repozytorium dodając flagę `--recursive` do polecenia `git clone`, LUB
2. W sklonowanym repozytorium wykonaj polecenie `git submodule update --init`
# Arcanist
Arcanist is a CLI tool that helps you submit your code changes for code review. You can use it to
* create, submit and update diffs (`arc diff`);
* land the changes after they've been reviewed (`arc land` - this equivalent to a "Merge");
* run unit tests and check code coverage (`arc lint`, `arc unit`)
== Installing Arcanist and the linters ==
Make sure you have `php` installed in your system.
```lang=bash
mkdir -p ~/bin
cd ~/bin
git clone https://we.phorge.it/source/arcanist.git arcanist
git clone https://hub.sealcode.org/diffusion/124/arcanist-linters.git
git clone https://github.com/sealcode/arc-unit-mocha.git
ln -s arcanist/bin/arc arc
# Add ~/bin to your `PATH` variable, if it's not there already:
echo "export PATH=\$PATH:$HOME/bin" >> ~/.bashrc
echo "export PATH=\$PATH:$HOME/bin" >> ~/.zshrc
# restart the terminal and check if this command:
which arc
# returns: /home/<your_username>/bin/arc
# If it returns something else, like /usr/bin/arc, then uninstall the arcanist package provided by your package manager
```
## Configuration
Run:
```
# arc install-certificate https://hub.sealcode.org/
```
and follow the instruction. It's a one-time command that will save authorization info for the future.
## Changing the default editor
Arcanist uses your shell's default text editor for diff messages. To pick your default editor, set the `EDITOR` env variable to an editor of your choice (you can do this in `~/.bashrc`, `~/.bash_profile`, or similar)
## Using Arcanist
Arcanist is needed for smooth operation of the Review Workflow. Read more about how to use Arcanist in [this guide]https://hub.sealcode.org/w/sealhub_workflow/audyt-i-review/review-workflow/).
To quickly login and test if it's working properly, you can run:
```
arc install-certificate https://hub.sealcode.org
```
Then follow the instructions, and run
```
arc set-config phabricator.uri https://hub.sealcode.org
echo {} | arc call-conduit -- user.whoami
```
If you see a JSON output with your account data, arcanist is set up properly
## Multiple concurrent reviews on the same repo
You can work on multiple tasks in the same local repository. While you're waiting for your changes on task to be reviewed, create a new branch starting from `master`, make some commits, and use `arc diff` again to submit a new revision for review.
-----
## Troubleshooting
### Error: `"Arc was unable to automagically make a name for this patch"`
If after running `arc patch` for the same diff multiple times in the same repo you see a message like this:
```
name="arc patch"
Branch name arcpatch-D300 already exists; trying a new name.
Branch name arcpatch-D300_1 already exists; trying a new name.
Branch name arcpatch-D300_2 already exists; trying a new name.
Branch name arcpatch-D300_3 already exists; trying a new name.
Exception
Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again.
(Run with `--trace` for a full exception trace.)
```
It means that `arc` ran out of branch names to keep your changes in.
```
name="git branch"
* alpha
arcpatch-D187
arcpatch-D188
arcpatch-D196
arcpatch-D213_1
arcpatch-D213_2
arcpatch-D217
arcpatch-D300_1
arcpatch-D300_2
arcpatch-D300_3
...
```
If you don't need those branches anymore, just delete them:
```
# git branch | cut -c3- | grep arcpatch- | xargs -n1 git branch -D
```
See https://secure.phabricator.com/T3277#33729 for more details
### Exception: Source file ".pinterest-linters/__phutil_library_init__.php" failed to load.
Solutions
1. Add `--recursive` flag to the `git clone` used for cloning pinterest linters repo, or
2. In arcanist linters repo, run `git submodule update --init`
### `failed to load symbol DomDocument` error
If you get this error, try installing the php-xml extension. On debian the command is:
```
sudo apt-get install php7.0-xml
```
NOTE: you may need to use a different version than `7.0`. You can check your current version with `php --version`. If it returns something like `8.1.2.`, then you need to install `php8.1-xml`.
# Arcanist
Arcanist is a CLI tool that helps you submit your code changes for code review. You can use it to
* create, submit and update diffs (`arc diff`);
* land the changes after they've been reviewed (`arc land` - this equivalent to a "Merge");
* run unit tests and check code coverage (`arc lint`, `arc unit`)
== Installing Arcanist and the linters ==
Make sure you have `php` installed in your system.
```lang=bash
mkdir -p ~/bin
cd ~/bin
git clone https://we.phorge.it/source/arcanist.git arcanist
git clone https://hub.sealcode.org/diffusion/124/arcanist-linters.git
git clone https://github.com/sealcode/arc-unit-mocha.git
ln -s arcanist/bin/arc arc
## Instalacja# Add ~/bin to your `PATH` variable, if it's not there already:
See this link for an installation guide: https://hub.sealcode.org/w/sealhub_workflow/linting/echo "export PATH=\$PATH:$HOME/bin" >> ~/.bashrc
echo "export PATH=\$PATH:$HOME/bin" >> ~/.zshrc
## Konfiguracja# restart the terminal and check if this command:
Wykonaj poleceniewhich arc
# returns: /home/<your_username>/bin/arc
# If it returns something else, like /usr/bin/arc, then uninstall the arcanist package provided by your package manager
```
## Configuration
Run:
```
# arc install-certificate https://hub.sealcode.org/
```
i podążaj zaand follow the instrukcjamiction. Jest to jednorazowy krok mający na celu uwierzytelnienie Arcanista na Twojej maszynie w danym repozytorium lokalnymIt's a one-time command that will save authorization info for the future.
## Wybór domyślnego edytora## Changing the default editor
Arcanist korzysta z domyślnego edytora,uses your shell's default text editor for diff messages. aby umożliwić konfigurację diffów (wliczając w to tytuły diffów i listę recenzentów).To pick your default editor, Aby wybrać domyślny edytorset the `EDITOR` env variable to an editor of your choice (you can do this in `~/.bashrc`, ustaw odpowiednio zmienną środowiskową `$EDITOR` (prawdopodobnie możesz to zrobić w Twoim pliku `~/.bashrc``~/.bash_profile`, w przypadku systemu OSX w pliku `~/.bash_profile`).or similar)
## Using Arcanist
## Korzystanie z ArcanistaArcanist is needed for smooth operation of the Review Workflow. Read more about how to use Arcanist in [this guide]https://hub.sealcode.org/w/sealhub_workflow/audyt-i-review/review-workflow/).
Arcanist jest wymagany do pracy w Review Workflow. W [dokumencie opisującym workflow](https://hub.sealcode.org/w/sealhub_workflow/audyt-i-review/review-workflow/) można przeczytać więcej o tymTo quickly login and test if it's working properly, jak korzystać z Arcanista.you can run:
## Kilka review naraz```
arc install-certificate https://hub.sealcode.org
```
Then follow the instructions, and run
```
arc set-config phabricator.uri https://hub.sealcode.org
echo {} | arc call-conduit -- user.whoami
```
If you see a JSON output with your account data, arcanist is set up properly
## Multiple concurrent reviews on the same repo
Może zdarzyć się, że wyślesz zmiany na review i pozostaje Ci czekać, aż ktoś je zrecenzujeYou can work on multiple tasks in the same local repository. W międzyczasie możesz oczywiście pracować nad innym diffem!While you're waiting for your changes on task to be reviewed, Załóż nowegocreate a new brancha starting from `master`, który ma zwój korzeń w `master`zemake some commits, wykonaj kilka commitów i ponownie możesz założyć nowyand use `arc diff` again to submit a new review request za pomocą polecenia `arc diff`sion for review.
-----
## Rozwiązywanie problemów## Troubleshooting
### Error: `"Arc was unable to automagically make a name for this patch"`
Jeżeli po kilkukrotnym odpaleniu `arc patch` na tegoIf after running `arc patch` for the same diff multiple times in the samego diff arc krzyczy:e repo you see a message like this:
```
name="arc patch"
Branch name arcpatch-D300 already exists; trying a new name.
Branch name arcpatch-D300_1 already exists; trying a new name.
Branch name arcpatch-D300_2 already exists; trying a new name.
Branch name arcpatch-D300_3 already exists; trying a new name.
Exception
Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again.
(Run with `--trace` for a full exception trace.)
```
Oznacza to, że wyczerpały się nazwy branchy,It means that `arc` ran out of branch names to keep your changes in. pod którymi trzymane są poprzednie patche tego samego diffa.
```
name="git branch"
* alpha
arcpatch-D187
arcpatch-D188
arcpatch-D196
arcpatch-D213_1
arcpatch-D213_2
arcpatch-D217
arcpatch-D300_1
arcpatch-D300_2
arcpatch-D300_3
...
```
Jeżeli nie potrzebujesz już żadnych poprzednich lokalnychIf you don't need those branchy w postaci `arcpatch-D...`es anymore, możesz je usunąć poleceniem:just delete them:
```
# git branch | cut -c3- | grep arcpatch- | xargs -n1 git branch -D
```
Więcej o rozwiązaniu tego problemu możesz przeczytać tutaj:See https://secure.phabricator.com/T3277#33729 for more details
### Exception: Source file ".pinterest-linters/__phutil_library_init__.php" failed to load.
Rozwiązania:Solutions
1. Add `--recursive` flag to the `git clone` used for cloning pinterest linters repo, or
2. In arcanist linters repo, run `git submodule update --init`
### `failed to load symbol DomDocument` error
1.If you get this error, Sklonuj repozytorium dodając flagę `--recursive` do polecenia `git clone`,try installing the php-xml extension. LUBOn debian the command is:
2. W sklonowanym repozytorium wykonaj polecenie `git submodule update --init````
sudo apt-get install php7.0-xml
```
NOTE: you may need to use a different version than `7.0`. You can check your current version with `php --version`. If it returns something like `8.1.2.`, then you need to install `php8.1-xml`.