Skip to content

Commit

Permalink
Updated documentation: Contributing section (nautobot#212)
Browse files Browse the repository at this point in the history
* Updated contributing section: How to debug the library locally

* Updated contributing section: How to debug the library locally

* Updated contributing section
  • Loading branch information
csessh authored Mar 8, 2023
1 parent d302083 commit 5a96986
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,41 @@ The project is following Network to Code software development guidelines and is
4. Update the `unit/test_e2e.py` with the new provider, providing some data to test and validate the final `Maintenances` created.
5. **Expose the new `Provider` class** updating the map `SUPPORTED_PROVIDERS` in `circuit_maintenance_parser/__init__.py` to officially expose the `Provider`.

### How to debug circuit-maintenance-parser library locally

1. `poetry install` updates the library and its dependencies locally.
2. `circuit-maintenance-parser` is now built with your recent local changes.

If you were to add loggers or debuggers to one of the classes:

```python
class HtmlParserZayo1(Html):
def parse_bs(self, btags: ResultSet, data: dict):
"""Parse B tag."""
raise Exception('Debugging exception')
```

After running `poetry install`:

```
-> % circuit-maintenance-parser --data-file ~/Downloads/zayo.eml --data-type email --provider-type zayo
Provider processing failed: Failed creating Maintenance notification for Zayo.
Details:
- Processor CombinedProcessor from Zayo failed due to: Debugging exception
```

> Note: `invoke build` will result in an error due to no Dockerfile. This is expected as the library runs simple pytest testing without a container.
```
-> % invoke build
Building image circuit-maintenance-parser:2.2.2-py3.8
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2B done
#1 DONE 0.0s
WARNING: failed to get git remote url: fatal: No remote configured to list refs from.
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1243547759/Dockerfile: no such file or directory
```

## Questions

For any questions or comments, please check the [FAQ](FAQ.md) first and feel free to swing by the [Network to Code slack channel](https://networktocode.slack.com/) (channel #networktocode).
Expand Down

0 comments on commit 5a96986

Please sign in to comment.