-
Notifications
You must be signed in to change notification settings - Fork 3
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
Linting, unit and integration tests pass for the frontend charm #16
Conversation
…elped by the tests: the relation was not getting updated when config (hostname or port) is changed.
@nadzyah re: formatting, I agree with your comment but would prefer to follow up in a separate re-formatting PR when we have formatting checks with Update: I did set things to 99 since actually that looks like the least disruptive setting. I have had a bunch of conflicting formatter plugins installed in VS Code on my workstations, which made my commits confused, apologies about that. |
|
||
COPY --from=builder /app/build/web /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY nginx.conf /etc/nginx/sites-available/test-observer-frontend | ||
RUN ln -s /etc/nginx/sites-available/test-observer-frontend /etc/nginx/sites-enabled/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved to an Ubuntu base here beside the obvious reasons also because I noticed that pebble had problems with finding nginx
from $PATH after I had moved to a multi-stage build (though it actually was present at /usr/sbin/nginx
, so not sure what it was about actually), and this was not happening with Ubuntu as the base.
logger.debug(f"API hostname: {api_hostname} (app: {event.app})") | ||
|
||
if self.unit.is_leader(): | ||
self._stored.backend_hostname = api_hostname | ||
self._stored.backend_port = api_port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the port was missing.
Why not use the same linter for backend charm as the one used for backend code? If we think ruff is better than black we can go with it. But then I feel it's better to have one linter and one linter rule set for both of backend and backend charm |
Looks like ruff is compatible with black if the line lengths are the same (which is 88 for black by default) |
Actually nvm, just noticed an issue as charm would use it's own virtual environment so linting wont work as some packages are specific to backend while others are to the charm |
Addresses RTW-101: Adds a GitHub workflow which uses tox to run for the frontend charm...
ubuntu:22.04
as base for the multi-stageDockerfile
for the frontend app (associated nginx config file path changes and charm changes)