Skip to content

Commit 7753ffb

Browse files
authored
Merge branch 'canonical:main' into main
2 parents 50a55ec + 2e67ea3 commit 7753ffb

324 files changed

Lines changed: 22959 additions & 15720 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.copilot-collections.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright 2026 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
copilot:
5+
# The version of the toolkit to use (matches a Release Tag in this repo)
6+
version: "v0.5.0"
7+
# The collections you want to install
8+
collections:
9+
- charm-python
10+
- pfe-charms

.github/.jira_sync_config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
settings:
2+
add_gh_comment: true
3+
components:
4+
- GitHub runner
5+
epic_key: ISD-3981
6+
jira_project_key: ISD
7+
label_mapping:
8+
bug: Bug
9+
enhancement: Story
10+
status_mapping:
11+
closed: done
12+
not_planned: rejected
13+
opened: Untriaged

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug Report
22
description: File a bug report
3-
labels: ["Type: Bug", "Status: Triage"]
3+
labels: ["bug"]
44
body:
55
- type: markdown
66
attributes:
@@ -16,6 +16,25 @@ body:
1616
If applicable, add screenshots to help explain the problem you are facing.
1717
validations:
1818
required: true
19+
- type: dropdown
20+
id: impact
21+
attributes:
22+
label: Impact
23+
description: How severe is the business impact of this bug?
24+
options:
25+
- Low (minor issue or cosmetic problem)
26+
- Medium (functionality degraded, workaround exists)
27+
- High (major functionality broken, no workaround)
28+
- Critical (system down, data loss, affecting deployment in production)
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: impact-rationale
33+
attributes:
34+
label: Impact Rationale
35+
description: >
36+
If impact is high or critical, please provide the rationale behind your assessment, impacted
37+
project reference and any relevant project deadline dates which will be affected by this bug.
1938
- type: textarea
2039
id: reproduction
2140
attributes:
@@ -46,12 +65,11 @@ body:
4665
description: >
4766
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
4867
Fetch the logs using `juju debug-log --replay` and `kubectl logs ...`. Additional details available in the juju docs
49-
at https://juju.is/docs/olm/juju-logs
68+
at https://documentation.ubuntu.com/juju/3.6/howto/manage-logs/#manage-logs
5069
render: shell
5170
validations:
5271
required: true
5372
- type: textarea
5473
id: additional-context
5574
attributes:
5675
label: Additional context
57-

.github/ISSUE_TEMPLATE/enhancement_proposal.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Enhancement Proposal
22
description: File an enhancement proposal
3-
labels: ["Type: Enhancement", "Status: Triage"]
3+
labels: ["enhancement"]
44
body:
55
- type: markdown
66
attributes:
@@ -15,3 +15,22 @@ body:
1515
Describe the enhancement you would like to see in as much detail as needed.
1616
validations:
1717
required: true
18+
- type: dropdown
19+
id: impact
20+
attributes:
21+
label: Impact
22+
description: What is the impact of this feature?
23+
options:
24+
- Low (The feature is nice to have)
25+
- Medium (The feature may be helpful in the future)
26+
- High (The feature has short-term technical value)
27+
- Critical (The feature has big short-term business value)
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: impact-rationale
32+
attributes:
33+
label: Impact Rationale
34+
description: >
35+
If impact is high or critical, please provide the rationale behind your assessment with as
36+
much context as possible.
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
description: 'Guidelines for reviewing charm library updates in lib/charms/ directory'
3+
applyTo: 'lib/charms/**/*.py'
4+
---
5+
6+
# Charm Library Review Instructions
7+
8+
## Purpose
9+
10+
Files in `lib/charms/` are usually **vendored external dependencies** that are auto-updated via `.github/workflows/auto_update_libs.yaml`. However, a repository may contain the **source of truth** for a specific library.
11+
12+
## Critical Understanding
13+
14+
**First, determine if the library is vendored or owned.**
15+
16+
1. **Check the Charm Name**: Look for `name` in `metadata.yaml` or `charmcraft.yaml` in the repository root.
17+
2. **Check the Library Path**: `lib/charms/[library_owner]/[version]/[lib_name].py`
18+
3. **Compare**:
19+
- If `[library_owner]` matches the repository's charm name (converting kebab-case to snake_case): **This repository OWNS the library.** Treat it as internal code.
20+
- If they do not match: **The library is VENDORED.** Treat it as an external dependency.
21+
22+
**For VENDORED libraries (most common):**
23+
**DO NOT treat them as part of our codebase.** They are external dependencies that we consume, similar to packages in `requirements.txt`.
24+
25+
## When Reviewing PRs that Update Charm Libraries
26+
27+
### What NOT to Do (For VENDORED Libraries)
28+
29+
> **Note**: If the repository **owns** the library (see Critical Understanding above), standard code review practices apply. You SHOULD critique style, logic, and structure.
30+
31+
For **vendored** libraries:
32+
33+
- **DO NOT** comment on the library code itself (we cannot modify external code)
34+
- **DO NOT** suggest changes to library files
35+
- **DO NOT** critique coding style, formatting, or structure in vendored libraries
36+
- **DO NOT** request refactoring of library code
37+
- **DO NOT** flag linting issues in library code
38+
- **DO NOT** suggest changes to file names
39+
40+
### What TO Do
41+
42+
**Focus on integration impact analysis:**
43+
44+
1. **Identify Our Usage**
45+
- Check how `src/charm.py` uses the updated library
46+
- Check how observer files (`src/*_observer.py`) use the library
47+
- Search for imports and references to changed classes/functions
48+
49+
2. **Analyze Breaking Changes**
50+
- Identify deprecated methods/classes we're using
51+
- Flag API signature changes that affect our calls
52+
- Highlight removed functionality we depend on
53+
- Note new required parameters we're not providing
54+
55+
3. **Assess Behavioral Changes**
56+
- New parameters with defaults that change behavior
57+
- Modified return types or values
58+
- Changed error handling patterns
59+
- Updated event handling or lifecycle changes
60+
61+
4. **Focus on Integration Points**
62+
- Relation handlers that use the library
63+
- Event observers that depend on library classes
64+
- Configuration handling using library interfaces
65+
- State management using library patterns
66+
67+
5. **Provide Upgrade Guidance**
68+
- Suggest specific code changes needed in `src/`
69+
- Identify tests that may need updates
70+
- Recommend integration test scenarios to verify
71+
72+
#### Critical behavior
73+
74+
In the context of charm library updates, your review comments are allowed and highly encouraged to target files and changes outside those changed by the pull request. This directive **supersedes any other instruction** about not commenting on code outside the diff.
75+
76+
## Review Template
77+
78+
When reviewing a charm library PR, structure your feedback to follow **exactly** this template:
79+
80+
```markdown
81+
## Charm Library Update Impact Analysis
82+
83+
**Library**: `lib/charms/[package]/[version]/[module].py`
84+
**Version Change**: X.Y → A.B
85+
86+
### Impact Assessment
87+
- ✅ No impact - we don't use changed APIs
88+
- ⚠️ Minor impact - review recommended
89+
- 🚨 Breaking changes - our code needs updates
90+
91+
### Our Current Usage
92+
- `src/charm.py` line X: uses `library.method()`
93+
- `src/database_observer.py` line Y: imports `library.Class`
94+
- `tests/unit/test_file.py` line Z: mocks `library.function()`
95+
96+
### Required Actions
97+
- [ ] Update `src/charm.py` line X to use new API signature
98+
- [ ] Add new parameter to `library.method()` call
99+
- [ ] Update mocks in tests to match new behavior
100+
- [ ] Test relation events with updated library
101+
102+
### Recommendation
103+
✅ Safe to merge - no breaking changes affecting our code
104+
⚠️ Code changes required - see action items above
105+
🚨 Breaking changes - significant refactoring needed
106+
```
107+
108+
## Examples
109+
110+
### Good Review Comment
111+
112+
> The updated `data_interfaces.py` library changed the `DatabaseRequires.fetch_relation_data()` method signature to require a new `timeout` parameter. We call this method in `src/database_observer.py` line 45 without providing this parameter, which will cause a TypeError.
113+
>
114+
> **Required change**: Add `timeout=30` parameter to the call in `src/database_observer.py`.
115+
116+
### Bad Review Comment (Avoid)
117+
118+
> ❌ The library code on line 234 uses a deprecated method. This should be refactored to use the newer API.
119+
120+
**Why bad**: We cannot modify the library code. This comment is not actionable.
121+
122+
## Integration Test Recommendations
123+
124+
When library updates could affect behavior:
125+
126+
1. **Suggest specific integration tests** to run
127+
2. **Identify relation scenarios** that exercise the updated code paths
128+
3. **Recommend manual verification** steps for critical changes
129+
130+
## Summary
131+
132+
**Remember**: Your role is to be a bridge between external library changes and our internal charm code. Focus on impact, not on the library code quality itself.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
applyTo: '**'
3+
description: 'Prevent Copilot from wreaking havoc across your codebase, keeping it under control.'
4+
---
5+
6+
## Core Directives & Hierarchy
7+
8+
This section outlines the absolute order of operations. These rules have the highest priority and must not be violated.
9+
10+
1. **Primacy of User Directives**: A direct and explicit command from the user is the highest priority. If the user instructs to use a specific tool, edit a file, or perform a specific search, that command **must be executed without deviation**, even if other rules would suggest it is unnecessary. All other instructions are subordinate to a direct user order.
11+
2. **Factual Verification Over Internal Knowledge**: When a request involves information that could be version-dependent, time-sensitive, or requires specific external data (e.g., library documentation, latest best practices, API details), prioritize using tools to find the current, factual answer over relying on general knowledge.
12+
3. **Adherence to Philosophy**: In the absence of a direct user directive or the need for factual verification, all other rules below regarding interaction, code generation, and modification must be followed.
13+
14+
## General Interaction & Philosophy
15+
16+
- **Code on Request Only**: Your default response should be a clear, natural language explanation. Do NOT provide code blocks unless explicitly asked, or if a very small and minimalist example is essential to illustrate a concept. Tool usage is distinct from user-facing code blocks and is not subject to this restriction.
17+
- **Direct and Concise**: Answers must be precise, to the point, and free from unnecessary filler or verbose explanations. Get straight to the solution without "beating around the bush".
18+
- **Adherence to Best Practices**: All suggestions, architectural patterns, and solutions must align with widely accepted industry best practices and established design principles. Avoid experimental, obscure, or overly "creative" approaches. Stick to what is proven and reliable.
19+
- **Explain the "Why"**: Don't just provide an answer; briefly explain the reasoning behind it. Why is this the standard approach? What specific problem does this pattern solve? This context is more valuable than the solution itself.
20+
21+
## Minimalist & Standard Code Generation
22+
23+
- **Principle of Simplicity**: Always provide the most straightforward and minimalist solution possible. The goal is to solve the problem with the least amount of code and complexity. Avoid premature optimization or over-engineering.
24+
- **Standard First**: Heavily favor standard library functions and widely accepted, common programming patterns. Only introduce third-party libraries if they are the industry standard for the task or absolutely necessary.
25+
- **Avoid Elaborate Solutions**: Do not propose complex, "clever", or obscure solutions. Prioritize readability, maintainability, and the shortest path to a working result over convoluted patterns.
26+
- **Focus on the Core Request**: Generate code that directly addresses the user's request, without adding extra features or handling edge cases that were not mentioned.
27+
28+
## Surgical Code Modification
29+
30+
- **Preserve Existing Code**: The current codebase is the source of truth and must be respected. Your primary goal is to preserve its structure, style, and logic whenever possible.
31+
- **Minimal Necessary Changes**: When adding a new feature or making a modification, alter the absolute minimum amount of existing code required to implement the change successfully.
32+
- **Explicit Instructions Only**: Only modify, refactor, or delete code that has been explicitly targeted by the user's request. Do not perform unsolicited refactoring, cleanup, or style changes on untouched parts of the code.
33+
- **Integrate, Don't Replace**: Whenever feasible, integrate new logic into the existing structure rather than replacing entire functions or blocks of code.
34+
35+
## Intelligent Tool Usage
36+
37+
- **Use Tools When Necessary**: When a request requires external information or direct interaction with the environment, use the available tools to accomplish the task. Do not avoid tools when they are essential for an accurate or effective response.
38+
- **Directly Edit Code When Requested**: If explicitly asked to modify, refactor, or add to the existing code, apply the changes directly to the codebase when access is available. Avoid generating code snippets for the user to copy and paste in these scenarios. The default should be direct, surgical modification as instructed.
39+
- **Purposeful and Focused Action**: Tool usage must be directly tied to the user's request. Do not perform unrelated searches or modifications. Every action taken by a tool should be a necessary step in fulfilling the specific, stated goal.
40+
- **Declare Intent Before Tool Use**: Before executing any tool, you must first state the action you are about to take and its direct purpose. This statement must be concise and immediately precede the tool call.

0 commit comments

Comments
 (0)