Version 3 vs 20
Version 3 vs 20
Edits
Edits
- Edit by kuba-orlik, Version 20
- Feb 29 2024 18:30
- Edit by arkadiusz-wieczorek, Version 3
- Mar 23 2018 10:42
Edit Older Version 3... | Edit Current Version 20... |
Content Changes
Content Changes
#### Arcanist
Arcanist to narzędzie umożliwiające wygodne nawigowanie po Review Workflow z poziomu linii komend. Potrafi m.in.:
* tworzyć diffy i wysyłać je na serwer (`arc diff`);
* aktualizować diffy (`arc diff`);
* finalizować diffy, squashować commity i wysyłać je na repozytorium (tzw. "land" - `arc land`);
Aby zacząć korzystać z Arcanista, zainstaluj go (powinien być w domyślnych repozytoriach Twojego systemu - w razie potrzeby więcej info [tutaj](https://secure.phabricator.com/book/phabricator/article/arcanist_quick_start/). Następnie, aby powiązać dane repozytorium z instancją Phabricatora (nasza instancja stoi na https://hub.sealcode.org), dodaj plik o nazwie `.arcconfig` w korzeniu repozytorium (jeżeli jeszcze go nie ma), o następującej zawartości:
```
lang=json, name=.arcconfig
{
"phabricator.uri" : "https://hub.sealcode.org/"
}
```
A nastepnie wykonaj polecenie
```
# arc install-certificate
```
i podążaj za instrukcjami. Jest to jednorazowy krok mający na celu uwierzytelnienie Arcanista na Twojej maszynie w danym repozytorium lokalnym.
Aby wysłać zmiany do review, wpisz:
```
# arc diff
```
i podążaj za instrukcjami na ekranie.
Aby zrobić "land", tzn. zrobić z całego diffa jeden commit i dodać go do domyślnego brancha, wpisz:
```
# arc land
```
#### 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` w katalogu domowym).
#### 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`.
# 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 to narzędzie umożliwiające wygodne nawigowanie po Review Workflow z poziomu linii komendis a CLI tool that helps you submit your code changes for code review. Potrafi m.in.:You can use it to
* tworzyć diffy i wysyłać je na serwer* create, submit and update diffs (`arc diff`);
* aktualizować diffy* land the changes after they've been reviewed (`arc diff`);land` - this equivalent to a "Merge");
* finalizować diffy* run unit tests and check code coverage (`arc lint`, squashować commity i wysyłać je na repozytorium (tzw. "land" - `arc land`);`arc unit`)
== Installing Arcanist and the linters ==
Make sure you have `php` installed in your system.
Aby zacząć korzystać z Arcanista, zainstaluj go (powinien być w domyślnych repozytoriach Twojego systemu - w razie potrzeby więcej info [tutaj](https://secure.phabricator.com/book/phabricator/article/arcanist_quick_start/). Następnie, aby powiązać dane repozytorium z instancją Phabricatora (nasza instancja stoi na```lang=bash
mkdir -p ~/bin
cd ~/bin
git clone https://we.phorge.it/source/arcanist.git arcanist
git clone https://hub.sealcode.org), dodaj plik o nazwie `.arcconfig` w korzeniu repozytorium (jeżeli jeszcze go nie ma), o następującej zawartości: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
lang=json, name=.arcconfigecho "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
"phabricator.uri" : "https://hub.sealcode.org/"```
## 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
```
A nastepnie wykonaj polecenieThen follow the instructions, and run
```
# arc install-certificatearc set-config phabricator.uri https://hub.sealcode.org
echo {} | arc call-conduit -- user.whoami
```
i podążaj za instrukcjami.If you see a JSON output with your account data, Jest to jednorazowy krok mający na celu uwierzytelnienie Arcanista na Twojej maszynie w danymarcanist is set up properly
## Multiple concurrent reviews on the same repozytorium lokalnym.o
Aby wysłać zmiany do reviewYou 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, wpiszand 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:
```
# arc diffname="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.)
```
i podążaj za instrukcjami na ekranie.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
...
```
Aby zrobić "land", tzn. zrobić z całego diffa jeden commit i dodać go do domyślnego branchaIf you don't need those branches anymore, wpisz:just delete them:
```
# arc land
# git branch | cut -c3- | grep arcpatch- | xargs -n1 git branch -D
```
#### Wybór domyślnego edytoraSee 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`
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` w katalogu domowym).### `failed to load symbol DomDocument` error
#### Kilka review narazIf you get this error, try installing the php-xml extension. On debian the command is:
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`.```
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`.