From d871c64d586aba725b1def84350931bda4f52f7e Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 15:42:21 +0100 Subject: [PATCH 1/9] Update README.md --- README.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c59088e..eba5b06 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# Jenkins-k8s Operator +# Jenkins-agent Operator -A [Juju](https://juju.is/) [charm](https://juju.is/docs/olm/charmed-operators) deploying and managing [Jenkins](https://www.jenkins.io/) Agents on machines. It is configurable to integrate with a Jenkins charm deployed in another Juju model. +[![CharmHub Badge](https://charmhub.io/jenkins-agent/badge.svg)](https://charmhub.io/jenkins-agent) +[![Publish to edge](https://github.com/canonical/jenkins-agent-operator/actions/workflows/publish_charm.yaml/badge.svg)](https://github.com/canonical/jenkins-agent-operator/actions/workflows/publish_charm.yaml) +[![Promote charm](https://github.com/canonical/jenkins-agent-operator/actions/workflows/promote_charm.yaml/badge.svg)](https://github.com/canonical/jenkins-agent-operator/actions/workflows/promote_charm.yaml) + +A [Juju](https://juju.is/) [charm](https://juju.is/docs/olm/charmed-operators) deploying and managing Jenkins agents on machines. It is configurable to integrate with a Jenkins charm deployed in another Juju model. This charm simplifies initial deployment and "day N" operations of Jenkins Agent on VMs and bare metal. @@ -8,13 +12,26 @@ As such, the charm makes it easy for those looking to take control of their own For DevOps or SRE teams this charm will make operating Jenkins Agent simple and straightforward through Juju's clean interface. It will allow easy deployment into multiple environments for testing changes, and supports scaling out for enterprise deployments. +For information about how to deploy, integrate, and manage this charm, see the Official [jenkins-agent charm Documentation](https://charmhub.io/jenkins-agent/docs). + +## Get started + +To begin, refer to the [Getting Started](https://charmhub.io/gateway-api-integrator/docs/tutorial-getting-started) tutorial for step-by-step instructions. + +### Basic operations + +#### Integrate with the Jenkins-k8S charm + +See the [deploy and integrate machine agents]([url](https://charmhub.io/jenkins-k8s/docs/tutorial-getting-started#deploy-and-integrate-machine-agents-optional)) section in the jenkins-k8s-operator documentation. + +## Learn more + +- [Read more](https://charmhub.io/jenkins-agent/docs) + ## Project and community The Jenkins-agent Operator is a member of the Ubuntu family. It's an open source project that warmly welcomes community projects, contributions, suggestions, fixes and constructive feedback. -- [Code of conduct](https://ubuntu.com/community/code-of-conduct) -- [Get support](https://discourse.charmhub.io/) -- [Join our online chat](https://app.element.io/#/room/#charmhub-charmdev:ubuntu.com) -- [Contribute](Contribute) - -Thinking about using the Jenkins-k8s Operator for your next project? [Get in touch](https://app.element.io/#/room/#charmhub-charmdev:ubuntu.com)! +* [Issues](https://github.com/canonical/jenkins-agent-operator/issues) +* [Contributing](https://charmhub.io/jenkins-agent#contributing-to-this-documentation) +- [Matrix](https://matrix.to/#/#charmhub-charmdev:ubuntu.com) From 0894187aff1d2ff2d9a9abadab06e0a94f78c327 Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 15:50:00 +0100 Subject: [PATCH 2/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eba5b06..6b4ef2c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ For information about how to deploy, integrate, and manage this charm, see the O ## Get started -To begin, refer to the [Getting Started](https://charmhub.io/gateway-api-integrator/docs/tutorial-getting-started) tutorial for step-by-step instructions. +To begin, refer to the [Getting Started](https://charmhub.io/jenkins-agent/docs/tutorial-getting-started) tutorial for step-by-step instructions. ### Basic operations From c0ffcf6c37d0ea474ee86e0166e53e2b269273e5 Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 15:53:33 +0100 Subject: [PATCH 3/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b4ef2c..b0f634d 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To begin, refer to the [Getting Started](https://charmhub.io/jenkins-agent/docs/ #### Integrate with the Jenkins-k8S charm -See the [deploy and integrate machine agents]([url](https://charmhub.io/jenkins-k8s/docs/tutorial-getting-started#deploy-and-integrate-machine-agents-optional)) section in the jenkins-k8s-operator documentation. +See the [deploy and integrate machine agents](https://charmhub.io/jenkins-k8s/docs/tutorial-getting-started#deploy-and-integrate-machine-agents-optional) section in the jenkins-k8s-operator documentation. ## Learn more From a45b827b17409c0596dfe0da62868c6c2604a116 Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 16:35:23 +0100 Subject: [PATCH 4/9] Update README.md Co-authored-by: Erin Conley --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0f634d..9a0b890 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A [Juju](https://juju.is/) [charm](https://juju.is/docs/olm/charmed-operators) deploying and managing Jenkins agents on machines. It is configurable to integrate with a Jenkins charm deployed in another Juju model. -This charm simplifies initial deployment and "day N" operations of Jenkins Agent on VMs and bare metal. +This charm simplifies the deployment and operations of Jenkins Agent on VMs and bare metal. As such, the charm makes it easy for those looking to take control of their own agents whilst keeping operations simple, and gives them the freedom to deploy on the platform of their choice. From f05d442ce847b2fe64baac36af2e5df95d6ef373 Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 16:35:29 +0100 Subject: [PATCH 5/9] Update README.md Co-authored-by: Erin Conley --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a0b890..b4b18df 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ For information about how to deploy, integrate, and manage this charm, see the O ## Get started -To begin, refer to the [Getting Started](https://charmhub.io/jenkins-agent/docs/tutorial-getting-started) tutorial for step-by-step instructions. +To begin, refer to the [tutorial](https://charmhub.io/jenkins-agent/docs/tutorial-getting-started) for step-by-step instructions. ### Basic operations From 8fb6f9a448cb01d569e60db316884f1455cc7cfa Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 16:37:37 +0100 Subject: [PATCH 6/9] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b4b18df..c735735 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,12 @@ See the [deploy and integrate machine agents](https://charmhub.io/jenkins-k8s/do ## Learn more - [Read more](https://charmhub.io/jenkins-agent/docs) +- [Troubleshooting](https://matrix.to/#/#charmhub-charmdev:ubuntu.com) ## Project and community The Jenkins-agent Operator is a member of the Ubuntu family. It's an open source project that warmly welcomes community projects, contributions, suggestions, fixes and constructive feedback. * [Issues](https://github.com/canonical/jenkins-agent-operator/issues) -* [Contributing](https://charmhub.io/jenkins-agent#contributing-to-this-documentation) +* [Contributing](https://github.com/canonical/jenkins-agent-operator/blob/main/CONTRIBUTING.md) - [Matrix](https://matrix.to/#/#charmhub-charmdev:ubuntu.com) From b81ea69f3a44086ef7231496a5def7302b3370be Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 20 Dec 2024 16:47:49 +0100 Subject: [PATCH 7/9] Update README.md Co-authored-by: Erin Conley --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c735735..b8e2700 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ The Jenkins-agent Operator is a member of the Ubuntu family. It's an open source * [Issues](https://github.com/canonical/jenkins-agent-operator/issues) * [Contributing](https://github.com/canonical/jenkins-agent-operator/blob/main/CONTRIBUTING.md) -- [Matrix](https://matrix.to/#/#charmhub-charmdev:ubuntu.com) +* [Matrix](https://matrix.to/#/#charmhub-charmdev:ubuntu.com) From 1cf9e892a02ddfa62da94e65077c6f8b262b82bd Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 17 Jan 2025 17:03:11 +0100 Subject: [PATCH 8/9] fix lint --- tests/integration/conftest.py | 5 ++--- tox.ini | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index b396387..0235de2 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -116,10 +116,9 @@ async def jenkins_server_fixture(jenkins_server_model: Model) -> Application: async def server_unit_ip_fixture(jenkins_server_model: Model, jenkins_server: Application): """Get Jenkins machine server charm unit IP.""" status: FullStatus = await jenkins_server_model.get_status([jenkins_server.name]) + jenkins_application = typing.cast(Application, status.applications[jenkins_server.name]) try: - unit_status: UnitStatus = next( - iter(status.applications[jenkins_server.name].units.values()) - ) + unit_status: UnitStatus = next(iter(jenkins_application.units.values())) assert unit_status.address, "Invalid unit address" return unit_status.address except StopIteration as exc: diff --git a/tox.ini b/tox.ini index cfd5fc0..9af1971 100644 --- a/tox.ini +++ b/tox.ini @@ -36,9 +36,9 @@ description = Check code against coding style standards deps = black codespell - flake8<6.0.0 + flake8 flake8-builtins - flake8-copyright<6.0.0 + flake8-copyright flake8-docstrings>=1.6.0 flake8-docstrings-complete>=1.0.3 flake8-test-docs>=1.0 @@ -47,7 +47,7 @@ deps = pep8-naming pydocstyle>=2.10 pylint - pyproject-flake8<6.0.0 + pyproject-flake8 pytest pytest-asyncio pytest-operator From c75e8dde981b413b1b9f1c1589bfa2af81dd0175 Mon Sep 17 00:00:00 2001 From: Phan Trung Thanh Date: Fri, 17 Jan 2025 17:12:49 +0100 Subject: [PATCH 9/9] update licence header --- charmcraft.yaml | 2 +- generate-src-docs.sh | 2 +- pyproject.toml | 2 +- src/agent_observer.py | 2 +- src/charm.py | 2 +- src/charm_state.py | 2 +- src/service.py | 2 +- templates/jenkins_agent.sh | 2 +- tests/__init__.py | 2 +- tests/conftest.py | 2 +- tests/integration/__init__.py | 2 +- tests/integration/conftest.py | 2 +- tests/integration/pre_run_script.sh | 2 +- tests/integration/test_agent.py | 2 +- tests/unit/__init__.py | 2 +- tests/unit/conftest.py | 2 +- tests/unit/test_agent.py | 2 +- tests/unit/test_charm.py | 2 +- tests/unit/test_service.py | 2 +- tests/unit/test_state.py | 2 +- tox.ini | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/charmcraft.yaml b/charmcraft.yaml index 86398b9..5400e17 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. name: jenkins-agent diff --git a/generate-src-docs.sh b/generate-src-docs.sh index d13066a..4e96bc2 100644 --- a/generate-src-docs.sh +++ b/generate-src-docs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. lazydocs --no-watermark --output-path src-docs src/* diff --git a/pyproject.toml b/pyproject.toml index 0cf41a0..f4f9131 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. [tool.bandit] diff --git a/src/agent_observer.py b/src/agent_observer.py index 27a34e5..c07e372 100644 --- a/src/agent_observer.py +++ b/src/agent_observer.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """The agent relation observer module.""" diff --git a/src/charm.py b/src/charm.py index 918049a..789e266 100755 --- a/src/charm.py +++ b/src/charm.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Charm jenkins agent.""" diff --git a/src/charm_state.py b/src/charm_state.py index 3266f13..1cc602f 100644 --- a/src/charm_state.py +++ b/src/charm_state.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """The module for managing charm state.""" diff --git a/src/service.py b/src/service.py index 26f885e..e350d4c 100644 --- a/src/service.py +++ b/src/service.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """The agent pebble service module.""" diff --git a/templates/jenkins_agent.sh b/templates/jenkins_agent.sh index 79a0da4..daf2f4f 100755 --- a/templates/jenkins_agent.sh +++ b/templates/jenkins_agent.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. err() { diff --git a/tests/__init__.py b/tests/__init__.py index fb1b031..57b5217 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Tests for the jenkins-agent operator.""" diff --git a/tests/conftest.py b/tests/conftest.py index 2ef7e01..e1d556d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Fixtures for jenkins-agent charm tests.""" diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 887614c..544f89c 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Integration tests module.""" diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 0235de2..49b6eb5 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Fixtures for Jenkins-agent-k8s-operator charm integration tests.""" diff --git a/tests/integration/pre_run_script.sh b/tests/integration/pre_run_script.sh index d17ed62..655e07a 100644 --- a/tests/integration/pre_run_script.sh +++ b/tests/integration/pre_run_script.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. # Pre-run script for integration test operator-workflows action. diff --git a/tests/integration/test_agent.py b/tests/integration/test_agent.py index a2ef459..1963210 100644 --- a/tests/integration/test_agent.py +++ b/tests/integration/test_agent.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Integration tests for jenkins-agent-k8s-operator charm.""" diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 3dbb54c..f7f4240 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Unit tests for the jenkins-agent operator.""" diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index b8fe301..5565a0d 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. """Fixtures for jenkins-agent charm tests.""" diff --git a/tests/unit/test_agent.py b/tests/unit/test_agent.py index b39466b..c4ab958 100644 --- a/tests/unit/test_agent.py +++ b/tests/unit/test_agent.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index f17cd27..d37ff04 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_service.py b/tests/unit/test_service.py index a7711ce..d80a137 100644 --- a/tests/unit/test_service.py +++ b/tests/unit/test_service.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_state.py b/tests/unit/test_state.py index 49d5e08..1f287f1 100644 --- a/tests/unit/test_state.py +++ b/tests/unit/test_state.py @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tox.ini b/tox.ini index 9af1971..7c25773 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ -# Copyright 2024 Canonical Ltd. +# Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. [tox]