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

Dev Updates #188

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changes/187.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Adds dependabot.yml control file to only update direct packages.
Adds watchmedo to the celery dev container to watch Python files and restart the celery worker.
Updates the example in the dev_contributing about the change fragments.
1 change: 1 addition & 0 deletions changes/187.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disables alert of WebEx token missing to only if WebEx is enabled.
12 changes: 12 additions & 0 deletions dependabot.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in the .github folder?

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
allow:
- dependency-type: "direct"
versioning-strategy: "increase"
- package-ecosystem: "pip"
directory: "/"
ignore:
- dependency-type: "indirect"
3 changes: 2 additions & 1 deletion development/creds.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ REDIS_PASSWORD=notverysecurepwd
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
NAUTOBOT_CREATE_SUPERUSER=true
NAUTOBOT_SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567
NAUTOBOT_SUPERUSER_PASSWORD=admin
NAUTOBOT_SUPERUSER_PASSWORD=admin
NAUTOBOT_LOG_LEVEL=DEBUG
2 changes: 2 additions & 0 deletions development/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ services:
depends_on:
- "postgres"
- "redis"
healthcheck:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking about this... I think we should do this, but it should be in docker-compose.dev.yml instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can get this moved, but brings up another question, what is the point of the docker-compose.dev.yml compared to docker-compose.yml within the development directory? Is it a bit too many files then, since everything in the directory should be a development file.

It's just a question that I really don't have an answer for.

disable: true
<<: *nautobot-build
<<: *nautobot-base
worker:
Expand Down
5 changes: 4 additions & 1 deletion development/docker-compose.celery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ services:
- "dev.env"
- "creds.env"
tty: true
entrypoint: "nautobot-server celery worker -l INFO"
entrypoint:
- "sh"
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events"
depends_on:
- "nautobot"
healthcheck:
Expand Down
8 changes: 4 additions & 4 deletions docs/dev/dev_contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_rack(dispatcher, site_slug, rack_id):
### `return CommandStatusChoices.STATUS_SUCCEEDED`

This indicates that the command was successful, and no further details are necessary in the logging.
You *could* return another status code besides `STATUS_SUCCEEDED` in this pattern, but in general any other status
You _could_ return another status code besides `STATUS_SUCCEEDED` in this pattern, but in general any other status
code should be accompanied by an explanatory message:

### `return (CommandStatusChoices.STATUS_FAILED, details_str)`
Expand Down Expand Up @@ -136,10 +136,10 @@ You shouldn't need to make any changes to the `workers` module in this scenario.
be assigned to you so that others are aware it's being worked on. A maintainer
will then mark the issue as "accepted."

- If you followed the project guidelines, have ample tests, code quality, you will first be acknowledged for your work. So, thank you in advance! After that, the PR will be quickly reviewed to ensure that it makes sense as a contribution to the project, and to gauge the work effort or issues with merging into *current*. If the effort required by the core team isn’t trivial, it’ll likely still be a few weeks before it gets thoroughly reviewed and merged, thus it won't be uncommon to move it to *near term* with a `near-term` label. It will just depend on the current backlog.
- If you followed the project guidelines, have ample tests, code quality, you will first be acknowledged for your work. So, thank you in advance! After that, the PR will be quickly reviewed to ensure that it makes sense as a contribution to the project, and to gauge the work effort or issues with merging into _current_. If the effort required by the core team isn’t trivial, it’ll likely still be a few weeks before it gets thoroughly reviewed and merged, thus it won't be uncommon to move it to _near term_ with a `near-term` label. It will just depend on the current backlog.

- All code submissions should meet the following criteria (CI will enforce
these checks):
these checks):
- Python syntax is valid
- All unit tests pass successfully
- PEP 8 compliance is enforced, with the exception that lines may be
Expand All @@ -149,7 +149,7 @@ these checks):

### Creating Changelog Fragments

All pull requests to `next` or `develop` must include a changelog fragment file in the `./changes` directory. To create a fragment, use your github issue number and fragment type as the filename. For example, `2362.added`. Valid fragment types are `added`, `changed`, `deprecated`, `fixed`, `removed`, and `security`. The change summary is added to the file in plain text. Change summaries should be complete sentences, starting with a capital letter and ending with a period, and be in past tense. Each line of the change fragment will generate a single change entry in the release notes. Use multiple lines in the same file if your change needs to generate multiple release notes in the same category. If the change needs to create multiple entries in separate categories, create multiple files.
All pull requests to `next` or `develop` must include a changelog fragment file in the `./changes` directory. To create a fragment, use your github issue number and fragment type as the filename. For example, `2362.added`. Valid fragment types are `added`, `changed`, `deprecated`, `fixed`, `removed`, and `security`. The change summary is added to the file in plain text. Change summaries should be complete sentences, starting with a capital letter and ending with a period, and be in past tense. Each line of the change fragment will generate a single change entry in the release notes. Use multiple lines in the same file if your change needs to generate multiple release notes in the same category. If the change needs to create multiple entries in separate categories, create multiple files. In the example below 1234 is the _issue_ number.

!!! example

Expand Down
9 changes: 5 additions & 4 deletions nautobot_chatops/api/views/webex.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
API = WebexTeamsAPI(access_token=TOKEN)
BOT_ID = API.people.me().id
except (AccessTokenError, ApiError):
logger.warning(
"Missing or invalid WEBEX_TOKEN setting. "
"This may be ignored if you are not running Nautobot as a WebEx chatbot."
)
if settings.PLUGINS_CONFIG["nautobot_chatops"].get("enable_webex"):
logger.warning(
"Missing or invalid WEBEX_TOKEN setting. "
"This may be ignored if you are not running Nautobot as a WebEx chatbot."
)
API = None
BOT_ID = None

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nautobot-chatops"
version = "1.11.0"
version = "1.11.1"
description = "A plugin providing chatbot capabilities for Nautobot"
authors = ["Network to Code, LLC <[email protected]>"]
readme = "README.md"
Expand Down