Skip to content
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

chore(core): minor cleanup #474

Merged
merged 12 commits into from
Aug 5, 2024
32 changes: 21 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ Contributions to this repository are welcome. As a contributor, here are the gui
## <a name="coc"></a> Code of Conduct

<!-- markdown-link-check-disable -->

Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).

<!-- markdown-link-check-enable -->

## <a name="question"></a> Question or Problem?

<!-- markdown-link-check-disable -->

Please use [GitHub Discussions](https://github.com/fetchai/uAgents/discussions) for support related questions and general discussions. Do NOT open issues as they are for bug reports and feature requests. This is because:

<!-- markdown-link-check-enable -->

- Questions and answers stay available for public viewing so your question/answer might help someone else.
Expand All @@ -33,8 +37,8 @@ Even better, you can [submit a Pull Request](#submit-pr) with a fix.

## <a name="feature"></a> Missing a Feature?

You can *request* a new feature by [submitting a feature request issue](#submit-issue).
If you would like to *implement* a new feature:
You can _request_ a new feature by [submitting a feature request issue](#submit-issue).
If you would like to _implement_ a new feature:

- For a **Major Feature**, first [open an issue](#submit-issue) and outline your proposal so that it can be discussed.
- **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
Expand All @@ -44,11 +48,13 @@ If you would like to *implement* a new feature:
### <a name="submit-issue"></a> Submitting an Issue

<!-- markdown-link-check-disable -->

Before you submit an issue, please search the [issue tracker](https://github.com/fetchai/uAgents/issues). An issue for your problem might already exist and the discussion might inform you of workarounds readily available.

For bug reports, it is important that we can reproduce and confirm it. For this, we need you to provide a minimal reproduction instruction (this is part of the bug report issue template).

You can file new issues by selecting from our [new issue templates](https://github.com/fetchai/uAgents/issues/new/choose) and filling out the issue template.

<!-- markdown-link-check-enable -->

### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Expand All @@ -57,26 +63,29 @@ Before you submit your Pull Request (PR) consider the following guidelines:

1. All Pull Requests should be based off of and opened against the `main` branch.

<!-- markdown-link-check-disable -->
<!-- markdown-link-check-disable -->

2. Search [Existing PRs](https://github.com/fetchai/uAgents/pulls) for an open or closed PR that relates to your submission.
You don't want to duplicate existing efforts.
<!-- markdown-link-check-enable -->

3. Be sure that an issue exists describing the problem you're fixing, or the design for the feature you'd like to add.

<!-- markdown-link-check-disable -->
<!-- markdown-link-check-disable -->

4. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the [repository](https://github.com/fetchai/uAgents).
<!-- markdown-link-check-enable -->
<!-- markdown-link-check-enable -->

5. In your forked repository, make your changes in a new git branch created off of the `main` branch.

6. Make your changes, **including test cases and documentation updates where appropriate**.

7. Follow our [coding rules](#rules).

<!-- markdown-link-check-disable -->
<!-- markdown-link-check-disable -->

8. Run all tests and checks locally, as described in the [development guide](DEVELOPING.md), and ensure they pass. This saves CI hours and ensures you only commit clean code.
<!-- markdown-link-check-enable -->
<!-- markdown-link-check-enable -->

9. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit).

Expand All @@ -87,7 +96,9 @@ Before you submit your Pull Request (PR) consider the following guidelines:
#### Reviewing a Pull Request

<!-- markdown-link-check-disable -->

The repository maintainers reserve the right not to accept pull requests from community members who haven't been good citizens of the community. Such behavior includes not following our [code of conduct](CODE_OF_CONDUCT.md) and applies within or outside the managed channels.

<!-- markdown-link-check-enable -->

When you contribute a new feature, the maintenance burden is transferred to the core team. This means that the benefit of the contribution must be compared against the cost of maintaining the feature.
Expand All @@ -111,13 +122,14 @@ After your pull request is merged, you can safely delete your branch and pull th
To ensure consistency throughout the source code, keep these rules in mind as you are working:

<!-- markdown-link-check-disable -->

- All code must pass our code quality checks (linters, formatters, etc). See the [development guide](DEVELOPING.md) section for more detail.
<!-- markdown-link-check-enable -->

- All features **must be tested** via unit-tests and if applicable integration-tests. Bug fixes also require tests, because the presence of bugs usually indicates insufficient test coverage. Tests help to:

1. Prove that your code works correctly, and
2. Guard against future breaking changes and lower the maintenance cost.
1. Prove that your code works correctly, and
2. Guard against future breaking changes and lower the maintenance cost.

- All public features **must be documented**.
- Keep API compatibility in mind when you change any code. Above version `1.0.0`, breaking changes can happen across versions with different left digit. Below version `1.0.0`, they can happen across versions with different middle digit. Reviewers of your pull request will comment on any API compatibility issues.
Expand Down Expand Up @@ -146,8 +158,6 @@ Commit messages should adhere to this standard and be of the form:
git commit -m "test: add test suite for feature x"
```

Further details on `conventional commits` can be found [here](https://www.conventionalcommits.org/en/v1.0.0/).

## <a name="merge"></a> Merging Pull Requests

When merging a branch, PRs should be squashed into one conventional commit by selecting the `Squash and merge` option. This ensures Release notes are useful and readable when releases are created.
Expand Down
7 changes: 5 additions & 2 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
## <a name="get"></a> Getting the Source

<!-- markdown-link-check-disable -->

1. Fork the [repository](https://github.com/fetchai/uAgents.git).
2. Clone your fork of the repository:
<!-- markdown-link-check-enable -->

``` shell
```shell
git clone https://github.com/fetchai/uAgents.git
```

3. Define an `upstream` remote pointing back to the main uAgents repository:

``` shell
```shell
git remote add upstream https://github.com/fetchai/uAgents.git
```

Expand Down Expand Up @@ -58,5 +59,7 @@ To run tests use the following command:
## <a name="contributing"></a>Contributing

<!-- markdown-link-check-disable -->

For instructions on how to contribute to the project (e.g. creating Pull Requests, commit message convention, etc), see the [contributing guide](CONTRIBUTING.md).

<!-- markdown-link-check-enable -->
35 changes: 26 additions & 9 deletions integrations/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,42 @@ Contributions to integrations are welcome 😊 the integrations repo is the plac

- Search the repo for the integration you're submitting, just in case.

- run [black](https://pypi.org/project/black/) on your code before submitting.
- run [ruff](https://github.com/astral-sh/ruff) on your code before submitting. (see `DEVELOPING.md`)

- Include a `project.json` file, example of:

```js
```json
{
"title": "Bert Base Uncased",
"description": "BERT base model (uncased) Pretrained model on English language using a masked language modeling (MLM) objective.",
"categories": ["Text Classification", "Hugging Face", "Text Generation"],
"deltav": false
"title": "Bert Base Uncased",
"description": "BERT base model (uncased) Pretrained model on English language using a masked language modeling (MLM) objective.",
"categories": ["Text Classification", "Hugging Face", "Text Generation"],
"deltav": false
}
```

Set deltav to true if your agent is built using agentverse and is accessible by DeltaV.
Set `deltav` to true if your agent is built using agentverse and is accessible by DeltaV.

## Commits and PRs

This project uses Conventional Commits to generate release notes and to determine versioning. Commit messages should adhere to this standard and be of the form:
This project uses Conventional Commits to generate release notes and to determine versioning.
When opening a PR please adhere to the following naming scheme where the type would be chosen based on the PRs goal and the title its description:

```
<type>(integration): <title>
```

### types

- **chore**: Commits that don't directly add features, fix bugs, or refactor code, but rather maintain the project or its surrounding processes.
- **ci**: Changes to our CI configuration files and scripts
- **docs**: Changes to the documentation
- **feat**: A new feature
- **fix**: A bug fix
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **test**: Adding missing tests or correcting existing tests
- **revert**: Reverts a previous commit that introduced an issue or unintended change. This essentially undoes a previous commit.
- **style**: Changes that only affect code formatting or style, without affecting functionality. This ensures consistency and readability of the codebase.
- **perf**: Changes that improve the performance of the project.

You will need to fork uAgents and then clone the repo to make PRs to this project. Please be descriptive in your commits:

Expand All @@ -36,7 +54,6 @@ git commit -m "test: add test suite for feature x"

Further details on `conventional commits` can be found here: <https://www.conventionalcommits.org/en/v1.0.0/>


## Support and help

Suppport and extra information is available in our [documentation](https://fetch.ai/docs) and on [Discord](https://discord.com/invite/fetchai)
8 changes: 7 additions & 1 deletion python/docs/api/uagents/envelope.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,11 @@ Verify the envelope's signature.

**Returns**:

- `bool` - True if the signature is valid, False otherwise.
- `bool` - True if the signature is valid.


**Raises**:

- `ValueError` - If the signature is missing.
- `ecdsa.BadSignatureError` - If the signature is invalid.

74 changes: 68 additions & 6 deletions python/docs/api/uagents/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,44 @@ This class provides methods to interact with the Almanac contract, including
checking if an agent is registered, retrieving the expiry height of an agent's
registration, and getting the endpoints associated with an agent's registration.

<a id="src.uagents.network.AlmanacContract.query_contract"></a>

#### query`_`contract

```python
def query_contract(query_msg: Dict[str, Any]) -> Any
```

Execute a query with additional checks and error handling.

**Arguments**:

- `query_msg` _Dict[str, Any]_ - The query message.


**Returns**:

- `Any` - The query response.


**Raises**:

- `RuntimeError` - If the contract address is not set or the query fails.

<a id="src.uagents.network.AlmanacContract.get_contract_version"></a>

#### get`_`contract`_`version

```python
def get_contract_version() -> str
```

Get the version of the contract.

**Returns**:

- `str` - The version of the contract.

<a id="src.uagents.network.AlmanacContract.is_registered"></a>

#### is`_`registered
Expand Down Expand Up @@ -173,7 +211,7 @@ Get the endpoints associated with an agent's registration.

**Returns**:

- `Any` - The endpoints associated with the agent's registration.
- `List[AgentEndpoint]` - The endpoints associated with the agent's registration.

<a id="src.uagents.network.AlmanacContract.get_protocols"></a>

Expand Down Expand Up @@ -267,12 +305,36 @@ This class provides methods to interact with the NameService contract, including
checking name availability, checking ownership, querying domain public status,
obtaining registration transaction details, and registering a name within a domain.

<a id="src.uagents.network.NameServiceContract.query_contract"></a>

#### query`_`contract

```python
def query_contract(query_msg: Dict[str, Any]) -> Any
```

Execute a query with additional checks and error handling.

**Arguments**:

- `query_msg` _Dict[str, Any]_ - The query message.


**Returns**:

- `Any` - The query response.


**Raises**:

- `RuntimeError` - If the contract address is not set or the query fails.

<a id="src.uagents.network.NameServiceContract.is_name_available"></a>

#### is`_`name`_`available

```python
def is_name_available(name: str, domain: str)
def is_name_available(name: str, domain: str) -> bool
```

Check if a name is available within a domain.
Expand All @@ -292,7 +354,7 @@ Check if a name is available within a domain.
#### is`_`owner

```python
def is_owner(name: str, domain: str, wallet_address: str)
def is_owner(name: str, domain: str, wallet_address: str) -> bool
```

Check if the provided wallet address is the owner of a name within a domain.
Expand All @@ -313,7 +375,7 @@ Check if the provided wallet address is the owner of a name within a domain.
#### is`_`domain`_`public

```python
def is_domain_public(domain: str)
def is_domain_public(domain: str) -> bool
```

Check if a domain is public.
Expand Down Expand Up @@ -354,8 +416,8 @@ Retrieve the previous records for a given name within a specified domain.

```python
def get_registration_tx(name: str, wallet_address: Address,
agent_records: List[Dict[str, Any]], domain: str,
test: bool)
agent_records: Union[List[Dict[str, Any]],
str], domain: str, test: bool)
```

Get the registration transaction for registering a name within a domain.
Expand Down
46 changes: 0 additions & 46 deletions python/examples/18-multi-agent-adapter/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions python/examples/18-multi-agent-adapter/project.json

This file was deleted.

Loading
Loading