instance_id stringlengths 10 57 | file_changes listlengths 1 15 | repo stringlengths 7 53 | base_commit stringlengths 40 40 | problem_statement stringlengths 11 52.5k | patch stringlengths 251 7.06M |
|---|---|---|---|---|---|
bvanelli__actualpy-70 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"actual/queries.py:create_transaction"
],
"edited_modules": [
"actual/queries.py:create_transaction"
]
},
"file": "actual/queries.py"
},
{
"changes": {
"ad... | bvanelli/actualpy | fb812112545fc3b9bcf5bcbf74a279c6d087b636 | run_rules() error
### Checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of actualpy.
### Reproducible example
```python
with Actual(base_url=URL_ACTUAL, password=PASSWORD_ACTUAL, file=FILE_ACTUAL) as actual:
actual.run_rules(... | diff --git a/actual/queries.py b/actual/queries.py
index d19efe3..7cc1a15 100644
--- a/actual/queries.py
+++ b/actual/queries.py
@@ -224,11 +224,16 @@ def create_transaction(
acct = get_account(s, account)
if acct is None:
raise ActualError(f"Account {account} not found")
+ if imported_payee:
+ ... |
bvanelli__actualpy-91 | [
{
"changes": {
"added_entities": [
"actual/database.py:ZeroBudgets.range",
"actual/database.py:ZeroBudgets.balance"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"actual/database.py:ZeroBudgets"
]
},
"file": "actual/dat... | bvanelli/actualpy | 2c89c523db6e579915ab07c6ffd375659e85c506 | Category from budgets should be scoped to the filtered month
### Description
I'd think something like
```python
budget = get_budget(actual.session, datetime.date.today(), 'Online Shopping')
LOGGER.debug("%s", budget.category.balance)
```
Would only include transactions from the filtered month instead of eve... | diff --git a/actual/database.py b/actual/database.py
index a131f91..2847a55 100644
--- a/actual/database.py
+++ b/actual/database.py
@@ -13,7 +13,7 @@ protobuf change message using [actual.database.BaseModel.convert][].
import datetime
import decimal
-from typing import Dict, List, Optional, Union
+from typing impo... |
bwhmather__python-validation-95 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"validation/datastructure.py:_validate_structure",
"validation/datastructure.py:_structure_validator.__init__",
"validation/datastructure.py:_structure_validator.__call__",
"valid... | bwhmather/python-validation | 691f9d1b0adce0bd8f026f37a26149cee65be1ab | Allow optional keys in validate_structure
Possible approaches:
- Pass a default value (probaly `None`) to nested validators if key is missing.
- Take a set of required values as a keyword argument.
- Take a set of optional values as a keyword argument. | diff --git a/validation/datastructure.py b/validation/datastructure.py
index 8863625..e7d5b52 100644
--- a/validation/datastructure.py
+++ b/validation/datastructure.py
@@ -463,7 +463,7 @@ def validate_mapping(
def _validate_structure(
value,
- schema=None, allow_extra=False,
+ schema=None, allow_extra=Fa... |
bwindsor__typed-config-8 | [
{
"changes": {
"added_entities": [
"typedconfig/config.py:Config._get_registered_properties_with_values",
"typedconfig/config.py:Config._resolve_section_name",
"typedconfig/config.py:Config._resolve_key_name",
"typedconfig/config.py:Config.post_read_hook",
"typedcon... | bwindsor/typed-config | c733c3a34dc0e7310807fa181ffb4a4cf7b69afc | Post configuration read transformations
I have a use case that has a very narrow set of supported values. Additionally, some configuration items may be inferred based on other values. Specifically, I'm looking at integrating [scrapy-redis](https://github.com/rmax/scrapy-redis) into a project and maintain the ability to... | diff --git a/README.md b/README.md
index 45aec6b..45935a4 100644
--- a/README.md
+++ b/README.md
@@ -171,6 +171,9 @@ In this example we have three ways of casting:
3. Defining a custom function. Your function should take one string input and return one output of any type. To get type hint, just make sure your function... |
byllyfish__precis_i18n-32 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"precis_i18n/profile.py:Nickname.additional_mapping_rule"
],
"edited_modules": [
"precis_i18n/profile.py:Nickname"
]
},
"file": "precis_i18n/profile.py"
}
] | byllyfish/precis_i18n | 6d39c4f14fa1d092b3b16a37a94d600a00cc7a49 | Nickname profile strips more whitespace characters than it should.
The Nickname profile includes an "additional mapping rule" that strips white space characters from both the beginning and end of the string. The current implementation uses the str.strip() method without a parameter. Python's default behavior defines a ... | diff --git a/precis_i18n/profile.py b/precis_i18n/profile.py
index 915e234..074f893 100644
--- a/precis_i18n/profile.py
+++ b/precis_i18n/profile.py
@@ -291,7 +291,7 @@ class Nickname(Profile):
def additional_mapping_rule(self, value):
# Override
temp = self.base.ucd.map_nonascii_space_to_ascii(v... |
byu-oit__awslogin-30 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"byu_awslogin/index.py:cli"
],
"edited_modules": [
"byu_awslogin/index.py:cli"
]
},
"file": "byu_awslogin/index.py"
},
{
"changes": {
"added_entities": nul... | byu-oit/awslogin | 8411dc178a022c92be40eeea820bcce1b15c2450 | Add optional parameter for region
Add an optional parameter to specify a region other than us-west-2. Use case is a Alexa and lex and potentially others aren't available in us-west-2 | diff --git a/README.rst b/README.rst
index ce35b06..0bdbd4b 100644
--- a/README.rst
+++ b/README.rst
@@ -66,6 +66,7 @@ To use it:
arguments as well.
- Run ``awslogin --profile <profile name>`` to specifiy an alternative
profile
+- Run ``awslogin --region <region name>`` to specify a different region. The def... |
byu-oit__awslogin-4 | [
{
"changes": {
"added_entities": [
"byu_awslogin/index.py:aws_file"
],
"added_modules": [
"byu_awslogin/index.py:aws_file"
],
"edited_entities": [
"byu_awslogin/index.py:cli",
"byu_awslogin/index.py:write_to_cred_file",
"byu_awslogin/index.py... | byu-oit/awslogin | 1a3ae19323a9c8a507ab0e8589a444bd827917e5 | Support for profiles as cli option
I don't use the default profile at all. This requires me to know in which environment I'm operating, as well as prevent accidental/malicious script execution from executing in a default account, whatever it may be.
CLI option could be --profile <profilename> or just a profile name,... | diff --git a/README.md b/README.md
index 1ee5dff..0be4965 100644
--- a/README.md
+++ b/README.md
@@ -12,14 +12,16 @@ BYU used to use the great [aws-adfs](https://github.com/venth/aws-adfs) CLI tool
* Run `pip3 install byu-awslogin`
## Usage
-awslogin automatically sets up the default profile in your ~/.aws/config a... |
byuccl__spydrnet-67 | [
{
"changes": {
"added_entities": [
"spydrnet/ir/element.py:Element.name"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"spydrnet/ir/element.py:Element"
]
},
"file": "spydrnet/ir/element.py"
}
] | byuccl/spydrnet | 4676e42351fc755708d8b017e39b10a0f5378333 | Add .name to elements as a pointer to ['NAME'] | diff --git a/spydrnet/ir/element.py b/spydrnet/ir/element.py
index ae406c5..24d33ef 100644
--- a/spydrnet/ir/element.py
+++ b/spydrnet/ir/element.py
@@ -36,6 +36,22 @@ class Element(object):
@property
def data(self):
return DictView(self._data)
+
+ @property
+ def name(self):
+ r... |
byuccl__spydrnet-70 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"spydrnet/ir/instance.py:Instance.reference"
],
"edited_modules": [
"spydrnet/ir/instance.py:Instance"
]
},
"file": "spydrnet/ir/instance.py"
}
] | byuccl/spydrnet | 5c5a891e246a31a846e59efdf164ca99568d77a1 | Reference tracking added to definitions, but references not removed when instance reference reassigned or deleted | diff --git a/spydrnet/ir/instance.py b/spydrnet/ir/instance.py
index 33b9d8b..2f739de 100644
--- a/spydrnet/ir/instance.py
+++ b/spydrnet/ir/instance.py
@@ -50,11 +50,14 @@ class Instance(Element):
pin._instance = None
pin._inner_pin = None
self._pins.clear()
+ ... |
c4urself__bump2version-119 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"bumpversion/cli.py:_load_configuration"
],
"edited_modules": [
"bumpversion/cli.py:_load_configuration"
]
},
"file": "bumpversion/cli.py"
}
] | c4urself/bump2version | fd54193c06fd1d6da3437151b277f7b38384debc | Support processing a file multiple times
For a certain file I needed to have two different serializations.
Turns out you can do that using `bumpversion.cfg` as long as the file name is written differently each time. I'm using a `./` prefix here.
[bumpversion:file:version.txt]
search = Version: {current_... | diff --git a/README.md b/README.md
index 4221d82..4f6fbf3 100644
--- a/README.md
+++ b/README.md
@@ -298,6 +298,11 @@ values =
This configuration is in the section: `[bumpversion:file:…]`
+Note: The configuration file format requires each section header to be
+unique. If you want to process a certain file multiple... |
c4urself__bump2version-128 | [
{
"changes": {
"added_entities": null,
"added_modules": [
"bumpversion/exceptions.py:BumpVersionException",
"bumpversion/exceptions.py:VersionNotFoundException"
],
"edited_entities": null,
"edited_modules": [
"bumpversion/exceptions.py:IncompleteVersionRepre... | c4urself/bump2version | f3d0035176452f990f57c44339d344065f11f21c | Don't fall back to original_version if `search` pattern is not found
This is one of the areas where bump2version does not work like I expect it to.
If for any reason (user error) the `search` pattern is not found, it simply assumes that it can replace `{current_version}` with the new version.
This can lead to inc... | diff --git a/bumpversion/exceptions.py b/bumpversion/exceptions.py
index ecce8b6..a635316 100644
--- a/bumpversion/exceptions.py
+++ b/bumpversion/exceptions.py
@@ -1,18 +1,28 @@
-class IncompleteVersionRepresentationException(Exception):
+
+
+class BumpVersionException(Exception):
+ """Custom base class for all Bum... |
c4urself__bump2version-41 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"bumpversion/cli.py:main",
"bumpversion/cli.py:_commit_to_vcs"
],
"edited_modules": [
"bumpversion/cli.py:main",
"bumpversion/cli.py:_commit_to_vcs"
]
},
... | c4urself/bump2version | 464802f3a54f1700671a27d02f56ef38ef6b15ae | Is exposing major/minor/patch in 'replace' desirable?
Hi,
I've been surprised a couple of times that I can use `{major}`, `{minor}` and `{patch}` placeholders in `serialize`, but not in `replace`. In replace, only `new_version` is available, which is already formatted by the `serialize` format.
Is this a design ... | diff --git a/Makefile b/Makefile
index ec555a6..7e411f4 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,9 @@ test:
docker-compose build test
docker-compose run test
+local_test:
+ PYTHONPATH=. py.test tests/
+
lint:
pip install pylint
pylint bumpversion
diff --git a/README.md b/README.md
index a8a7454..7e67e... |
c4urself__bump2version-46 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"bumpversion/__init__.py:VersionConfig.parse",
"bumpversion/__init__.py:main"
],
"edited_modules": [
"bumpversion/__init__.py:VersionConfig",
"bumpversion/__init__.py:... | c4urself/bump2version | 219376fcfc1e9cff7e06945b8657843b683b3fe0 | Fix deprecation errors on pytest v4.0.x
PyTest version `4.0.0` is released and this is breaking both Travis and AppVeyor on deprecation errors.
I stumbled into this in #41.
The main issue seems to be this one: https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize .
You can turn t... | diff --git a/README.md b/README.md
index 9a2fbf3..53391fb 100644
--- a/README.md
+++ b/README.md
@@ -5,9 +5,11 @@
## NOTE
This is an interim fork of the excellent project that can be found here: https://github.com/peritus/bumpversion
+
Unfortunately it seems like development has been stuck for some time and no act... |
cablelabs__snaps-kubernetes-134 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "snaps_k8s/common/consts/consts.py"
},
{
"changes": {
"added_entities": [
"snaps_k8s/common/utils/config_utils.py:get_k8s_dict",
... | cablelabs/snaps-kubernetes | f3ce36dc52d23c4cab98a900965a39ee03a99b40 | Complete config refactor
The initial configuration refactor did not address validation_utils.py and a few places in k8_utils.py & ansible_configuration.py | diff --git a/snaps_k8s/common/consts/consts.py b/snaps_k8s/common/consts/consts.py
index 3b2d86e..eae80a5 100644
--- a/snaps_k8s/common/consts/consts.py
+++ b/snaps_k8s/common/consts/consts.py
@@ -38,8 +38,8 @@ NO_PROXY_KEY = 'no_proxy'
NODE_CONF_KEY = 'node_configuration'
CEPH_VOLUME_KEY = 'Ceph_Volume'
NODE_TYPE_K... |
cablelabs__transparent-security-223 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"trans_sec/analytics/oinc.py:PacketAnalytics._send_attack"
],
"edited_modules": [
"trans_sec/analytics/oinc.py:PacketAnalytics"
]
},
"file": "trans_sec/analytics/oinc.py... | cablelabs/transparent-security | 42d46559f511a9c2ea81d6a02e92ac7187e36581 | Refactor RESTful APIs for only one class per create/delete API
http_server_flask.py currently has 2 classes for each data_drop insert/delete (Gateway & Aggregate). As each is being called via POST while using the same payload, the delete method should be created from the remove classes "post" methods. | diff --git a/playbooks/scenarios/full/packet-flood.yml b/playbooks/scenarios/full/packet-flood.yml
index ab87387..29ea56e 100644
--- a/playbooks/scenarios/full/packet-flood.yml
+++ b/playbooks/scenarios/full/packet-flood.yml
@@ -41,8 +41,7 @@
send_loops: 2
send_loop_delay: 5
cleanup_rest_call:
- url... |
caesar0301__treelib-180 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "examples/family_tree.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"examples/fol... | caesar0301/treelib | 03c6374beecdc93f704cb6cfd1623e41d70873e4 | When i create a Tree , its not maintaining the order which in i created the children when i invoke show method
>>> from treelib import Node, Tree
>>> tree = Tree()
>>> tree.create_node('Students', 'Students', parent=None)
Node(tag=Students, identifier=Students, data=None)
>>> tree.create_node('Ben', 'Ben',parent='S... | diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index fc7a708..5ffa075 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -56,4 +56,4 @@ jobs:
./scripts/flake8.sh
- name: Test with pytest
run: |
- pytest
\ ... |
caesar0301__treelib-40 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"treelib/tree.py:Tree._print_backend"
],
"edited_modules": [
"treelib/tree.py:Tree"
]
},
"file": "treelib/tree.py"
}
] | caesar0301/treelib | 65635f48781f4426be9f55f1555d0c08454157bc | AttributeError: 'str' object has no attribute 'decode'
python3.4, OSX 10.10
```python
>>> from treelib import Tree, Node
>>> tree = Tree()
>>> tree.create_node("Harry", "harry")
>>> tree.create_node("Jane", "jane", parent="harry")
>>> tree.show()
Traceback (most recent call last):
File "<stdin>", line 1, ... | diff --git a/treelib/tree.py b/treelib/tree.py
index 9bcf610..634566c 100644
--- a/treelib/tree.py
+++ b/treelib/tree.py
@@ -556,16 +556,16 @@ class Tree(object):
if not self.contains(nid):
raise NodeIDAbsentError("Node '%s' is not in the tree" % nid)
- label = ('{0}'.format(self[nid].tag... |
cage-challenge__cage-challenge-4-21 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"CybORG/Agents/Wrappers/BlueFlatWrapper.py:BlueFlatWrapper.step",
"CybORG/Agents/Wrappers/BlueFlatWrapper.py:BlueFlatWrapper.observation_change",
"CybORG/Agents/Wrappers/BlueFlatWrapper.p... | cage-challenge/cage-challenge-4 | 74d9ad052407bb430892d3f1f6cb6aa94ac0dc16 | Challenge 4 BlueEnterpriseWrapper, incorrect communication policy vectors in observations
[Appendix B - Agent observation](https://github.com/cage-challenge/cage-challenge-4?tab=readme-ov-file#appendix-b--agent-observation) of the README states that agent observation vectors contain the communication policy for each su... | diff --git a/CybORG/Agents/Wrappers/BlueFlatWrapper.py b/CybORG/Agents/Wrappers/BlueFlatWrapper.py
index 022bcd8..7faa771 100644
--- a/CybORG/Agents/Wrappers/BlueFlatWrapper.py
+++ b/CybORG/Agents/Wrappers/BlueFlatWrapper.py
@@ -120,7 +120,7 @@ class BlueFlatWrapper(BlueFixedActionWrapper):
observations = {
... |
caglorithm__mopet-26 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"mopet/mopet.py:Exploration._read_group_as_dict"
],
"edited_modules": [
"mopet/mopet.py:Exploration"
]
},
"file": "mopet/mopet.py"
},
{
"changes": {
"added... | caglorithm/mopet | 309dc0607de03ef9ddebe87140ca8cceecf64f33 | bool values get transformed to numpy float type
### Description
Problem is that 0 dim arrays get always converted to float without checking the type of the given value.
### Minimal Example:
```python
import numpy as np
from mopet import mopet
def run(params):
return {
"test": True,
... | diff --git a/mopet/mopet.py b/mopet/mopet.py
index 91b380f..f8abbae 100644
--- a/mopet/mopet.py
+++ b/mopet/mopet.py
@@ -547,11 +547,10 @@ class Exploration:
for array in group:
if isinstance(array, tables.array.Array):
value = array.read()
- if not isinstance(value... |
caleb531__automata-121 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"automata/fa/nfa.py:NFA.from_regex"
],
"edited_modules": [
"automata/fa/nfa.py:NFA"
]
},
"file": "automata/fa/nfa.py"
},
{
"changes": {
"added_entities": [... | caleb531/automata | f5ed05a815cc001c47a8442953706cbf2ca28bff | Support for quantifiers and the shuffle operator in regular expressions
Is there a specific reason why quantifiers for regular expressions are not supported? (so things like `a{2,10}`) If there is no specific reason, would you be open to a PR that implements it?
Also, what do you think of adding a special regex shuf... | diff --git a/automata/fa/nfa.py b/automata/fa/nfa.py
index 0e45bf5..e00673e 100644
--- a/automata/fa/nfa.py
+++ b/automata/fa/nfa.py
@@ -6,11 +6,14 @@
import networkx as nx
from frozendict import frozendict
from pydot import Dot, Edge, Node
+import string
import automata.base.exceptions as exceptions
import auto... |
caleb531__automata-123 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"automata/base/utils.py:PartitionRefinement.refine"
],
"edited_modules": [
"automata/base/utils.py:PartitionRefinement"
]
},
"file": "automata/base/utils.py"
},
{
... | caleb531/automata | 5987d5d276cf10662956c2266eb088ffd95b9760 | problems with GNFA.to_regex
GNFA.to_regex seems to give wrong results sometimes. For example, the following code:
```
from automata.fa.dfa import DFA
from automata.fa.nfa import NFA
from automata.fa.gnfa import GNFA
nfa = NFA.from_regex('a*')
dfa = DFA.from_nfa(nfa)
gnfa = GNFA.from_dfa(dfa)
print(gnfa.to_reg... | diff --git a/automata/base/utils.py b/automata/base/utils.py
index 07611a8..98c8706 100644
--- a/automata/base/utils.py
+++ b/automata/base/utils.py
@@ -81,7 +81,7 @@ def refine(self, S):
Not a generator because we need to perform the partition
even if the caller doesn't iterate through the results.
... |
caleb531__automata-136 | [
{
"changes": {
"added_entities": [
"automata/regex/parser.py:add_concat_and_empty_string_tokens"
],
"added_modules": [
"automata/regex/parser.py:add_concat_and_empty_string_tokens"
],
"edited_entities": [
"automata/regex/parser.py:add_concat_tokens",
... | caleb531/automata | af08ca85d0476fed25425a48cc811453b4bd2e91 | How to express the empty string in regexes?
Is there a way to specify the empty string as part of regexes? For example, Python's built-in re.compile allows expressions like `'()'` or `'|'`, but the parser in this library throws an error on both. | diff --git a/automata/regex/parser.py b/automata/regex/parser.py
index 61f0e10..098e3cb 100644
--- a/automata/regex/parser.py
+++ b/automata/regex/parser.py
@@ -492,8 +492,9 @@ def val(self) -> NFARegexBuilder:
return NFARegexBuilder.wildcard(self.input_symbols, self.counter)
-def add_concat_tokens(
+def a... |
caleb531__automata-63 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"automata/fa/dfa.py:DFA.from_nfa"
],
"edited_modules": [
"automata/fa/dfa.py:DFA"
]
},
"file": "automata/fa/dfa.py"
}
] | caleb531/automata | 80987709928431572be930d9242968276c3845f7 | Conversion from DFA to NFA does not properly handle state names of mixed data types
I found the following bug:
nfa._add_new_state introduces integers into the set of states.
Current code is:
```
def _add_new_state(state_set, start=0):
"""Adds new state to the state set and returns it"""
new_... | diff --git a/README.md b/README.md
index 2941653..6431318 100644
--- a/README.md
+++ b/README.md
@@ -317,9 +317,10 @@ Returns `True` if the DFA accepts a finite language, False otherwise.
dfa.isfinite()
```
-#### DFA.from_nfa(cls, nfa)
+#### DFA.from_nfa(cls, nfa, retain_names=False)
-Creates a DFA that is equiva... |
camptocamp__python-geoservercloud-51 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"geoservercloud/models/featuretype.py:FeatureType.from_get_response_payload"
],
"edited_modules": [
"geoservercloud/models/featuretype.py:FeatureType"
]
},
"file": "geos... | camptocamp/python-geoservercloud | 77747913c8a6342d35b1471a3b987c12b1e171f0 | FeatureType BBOX not synched when copying a workspace
The BBOX of the FeatureTypes are not synched when copying a workspace.
To reproduce:
- create a layer on geoserverA with a BBOX computed from SRS
- copy it to geoserverB
the new created featureType should have the same the same BBOX as the original, but inst... | diff --git a/geoservercloud/models/featuretype.py b/geoservercloud/models/featuretype.py
index ea35a47..2b761d4 100644
--- a/geoservercloud/models/featuretype.py
+++ b/geoservercloud/models/featuretype.py
@@ -140,6 +140,8 @@ class FeatureType(EntityModel):
projection_policy=feature_type["projectionPolicy"]... |
camptocamp__python-geoservercloud-52 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"geoservercloud/models/featuretype.py:FeatureType.__init__",
"geoservercloud/models/featuretype.py:FeatureType.from_get_response_payload",
"geoservercloud/models/featuretype.py:FeatureTyp... | camptocamp/python-geoservercloud | 3df141679ce7f33851294ff1348fa113ec62d304 | Add support for FeatureType without `keyword`
```
File ~/code/python-geoservercloud/geoservercloud/models/featuretype.py:133, in FeatureType.from_get_response_payload(cls, content)
121 else:
122 metadata_links = None
124 return cls(
125 namespace_name=feature_type["namespace"]["name"],
... | diff --git a/geoservercloud/models/featuretype.py b/geoservercloud/models/featuretype.py
index 2b761d4..d117d47 100644
--- a/geoservercloud/models/featuretype.py
+++ b/geoservercloud/models/featuretype.py
@@ -41,7 +41,7 @@ class FeatureType(EntityModel):
namespace_name: str | None = None,
title: dict[... |
camptocamp__python-geoservercloud-58 | [
{
"changes": {
"added_entities": [
"geoservercloud/geoservercloud.py:GeoServerCloud.delete_feature_type"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"geoservercloud/geoservercloud.py:GeoServerCloud"
]
},
"file": "geoserverclo... | camptocamp/python-geoservercloud | 8500c2749001d5f130451a908e466a7109849ee0 | Handle default value of i18n attribute on PUT
When doing a PUT on an object with an i18n attribute (for instance `internationalTitle` in a feature type) it seems GeoServer will takes the first of the translation values and set it as the non-i18ned value (for instance `title`). This value than acts as a default value in... | diff --git a/geoservercloud/geoservercloud.py b/geoservercloud/geoservercloud.py
index 7c1fea6..52a5b10 100644
--- a/geoservercloud/geoservercloud.py
+++ b/geoservercloud/geoservercloud.py
@@ -392,6 +392,16 @@ class GeoServerCloud:
)
return self.rest_service.create_feature_type(feature_type=feature_ty... |
cancervariants__gene-normalization-395 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/gene/query.py:QueryHandler._add_merged_meta",
"src/gene/query.py:QueryHandler._add_gene"
],
"edited_modules": [
"src/gene/query.py:QueryHandler"
]
},
"file"... | cancervariants/gene-normalization | 82b75d31a10fdfa38aa96d412981d6a9b6820659 | `Coding` object in mappings is not being represented correctly
### Describe the bug
I had met with Alex to review CIViC assertion representation using the latest GKS ballot releases. During this review, he noted we should be representing `Coding` objects in `mappings` differently than what is stated by the description... | diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml
index ba000a7..3922bf1 100644
--- a/.github/workflows/checks.yaml
+++ b/.github/workflows/checks.yaml
@@ -2,7 +2,7 @@ name: Tests
on: [push, pull_request]
jobs:
test:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
strategy:
... |
canonical__charmcraft-1165 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/charm_builder.py:CharmBuilder.__init__",
"charmcraft/charm_builder.py:CharmBuilder._install_dependencies"
],
"edited_modules": [
"charmcraft/charm_builder.py:Charm... | canonical/charmcraft | 57858344491374f189c8c277a2f6a2fe4c8d77d3 | spread tests: notebook-operators failing to build
### Bug Description
https://github.com/canonical/charmcraft/actions/runs/5593782587
### To Reproduce
1. `git clone https://github.com/canonical/notebook-operators`
2. `cd notebook-operators`
3. `charmcraft pack --include-all-charms`
This doesn't seem to be an is... | diff --git a/charmcraft/charm_builder.py b/charmcraft/charm_builder.py
index 7189c795..213e2f94 100644
--- a/charmcraft/charm_builder.py
+++ b/charmcraft/charm_builder.py
@@ -25,8 +25,8 @@ import hashlib
import os
import pathlib
import shutil
-import sys
import subprocess
+import sys
from typing import List
fro... |
canonical__charmcraft-1204 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/metafiles/actions.py:parse_actions_yaml",
"charmcraft/metafiles/actions.py:create_actions_yaml"
],
"edited_modules": [
"charmcraft/metafiles/actions.py:parse_actio... | canonical/charmcraft | d31cd0b4fb338c47503437957be49271fb45bd45 | Doesn't support nested `any-of` expressions in `metadata.yaml` `assumes`
### Bug Description
Juju supports nested `any-of` and `all-of` expressions in `metadata.yaml`'s `assumes:`
charmcraft fails to pack charms with nested expressions.
If you pack a charm with charmcraft, unzip the file, add the nested expres... | diff --git a/charmcraft/metafiles/actions.py b/charmcraft/metafiles/actions.py
index 95d5bf22..31d2bbe3 100644
--- a/charmcraft/metafiles/actions.py
+++ b/charmcraft/metafiles/actions.py
@@ -16,15 +16,18 @@
"""Charmcraft project handle actions.yaml file."""
+import contextlib
import pathlib
import logging
impor... |
canonical__charmcraft-1228 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:CreateLibCommand.run"
],
"edited_modules": [
"charmcraft/commands/store/__init__.py:CreateLibCommand"
]
},
"file": "charmcraft/com... | canonical/charmcraft | f4dd212d03502944642b73b7949135ac9982029e | `create-lib` command breaks without a metadata.yaml file
### Bug Description
Without a `metadata.yaml` file, `charmcraft create-lib` fails. However, it only needs this to get the charm name.
### To Reproduce
`charmcraft init` (or with any explicit profile)
`charmcraft create-lib mylib`
### Environment
N/A
### ch... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index fb7c8e9c..efd9445c 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -1298,11 +1298,11 @@ class CreateLibCommand(BaseCommand):
"characters and underscore, sta... |
canonical__charmcraft-1365 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/utils/package.py:get_pypi_packages"
],
"edited_modules": [
"charmcraft/utils/package.py:get_pypi_packages"
]
},
"file": "charmcraft/utils/package.py"
}
] | canonical/charmcraft | acf98be9c75e25e31050b8c40381e4c08e11245f | New dependency resolution fails with empty lines in requirements file
### Bug Description
https://github.com/canonical/charmcraft/actions/runs/6210409286/job/16858681237
Empty requirements lines cause an IndexError
### To Reproduce
run the `tests/spread/charms/k8s-operator:redis` spread test
### Environment
spr... | diff --git a/charmcraft/utils/package.py b/charmcraft/utils/package.py
index d25b8a21..325518f4 100644
--- a/charmcraft/utils/package.py
+++ b/charmcraft/utils/package.py
@@ -36,7 +36,7 @@ def get_pypi_packages(*requirements: Iterable[str]) -> set[str]:
for req in requirements:
for line in req:
... |
canonical__charmcraft-1615 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/main.py:Charmcraft._extra_yaml_transform"
],
"edited_modules": [
"charmcraft/application/main.py:Charmcraft"
]
},
"file": "charmcraft/application... | canonical/charmcraft | 0fbe2f8085de31b3997be4877f733f70f650b15e | Move additional YAML file loads into _extra_yaml_transform
### What needs to get done
Instead of using the CharmcraftProject model's `from_yaml_file` method to do everything, preprocess the following files in functions called from _extra_yaml_transform:
- [ ] bundle.yaml (this can be added to the `_bundle` extens... | diff --git a/charmcraft/application/main.py b/charmcraft/application/main.py
index cf4b60a7..cd59750f 100644
--- a/charmcraft/application/main.py
+++ b/charmcraft/application/main.py
@@ -69,6 +69,8 @@ class Charmcraft(Application):
preprocess.add_default_parts(yaml_data)
preprocess.add_bundle_snippe... |
canonical__charmcraft-1701 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/commands/store.py:FetchLibs.run"
],
"edited_modules": [
"charmcraft/application/commands/store.py:FetchLibs"
]
},
"file": "charmcraft/application... | canonical/charmcraft | f46fb734281b62abd11e2389f7279373a75da8bf | `fetch-libs` crashes with an internal error
### Bug Description
After logging in and running `fetch-libs`, there is an internal error `charmcraft internal error: StoreServerError("Store operation failed:\n- None: Items need to include 'library_id' or 'package_id'")`
### To Reproduce
1. Create a multipass VM
2. Inst... | diff --git a/charmcraft/application/commands/store.py b/charmcraft/application/commands/store.py
index 0e2374bb..a0df916d 100644
--- a/charmcraft/application/commands/store.py
+++ b/charmcraft/application/commands/store.py
@@ -1700,10 +1700,11 @@ class FetchLibs(CharmcraftCommand):
lib_name = f"{lib_md.cha... |
canonical__charmcraft-1702 | [
{
"changes": {
"added_entities": [
"charmcraft/services/store.py:StoreService.setup"
],
"added_modules": null,
"edited_entities": [
"charmcraft/services/store.py:StoreService.get_libraries_metadata",
"charmcraft/services/store.py:StoreService.get_library"
],... | canonical/charmcraft | fb8680ec656f2e261dcd145a2a1371dfd4e0d594 | `fetch-libs` crashes with an internal error
### Bug Description
After logging in and running `fetch-libs`, there is an internal error `charmcraft internal error: StoreServerError("Store operation failed:\n- None: Items need to include 'library_id' or 'package_id'")`
### To Reproduce
1. Create a multipass VM
2. Inst... | diff --git a/charmcraft/services/store.py b/charmcraft/services/store.py
index 785a9da0..546a7996 100644
--- a/charmcraft/services/store.py
+++ b/charmcraft/services/store.py
@@ -22,6 +22,7 @@ from collections.abc import Collection, Mapping, Sequence
import craft_application
import craft_store
from craft_store impor... |
canonical__charmcraft-1741 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/services/store.py:BaseStoreService.setup"
],
"edited_modules": [
"charmcraft/services/store.py:BaseStoreService"
]
},
"file": "charmcraft/services/store.py"
... | canonical/charmcraft | 8f64d66a11bbba33604af734946cc730fcac9540 | Getting an internal error for fetch-libs
### Bug Description
I'm getting an internal error when running the fetch-libs command:
```bash
charmcraft fetch-libs
charmcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.')
```
### To Reproduce
- `charmcraft init --profile fl... | diff --git a/charmcraft/services/store.py b/charmcraft/services/store.py
index 546a7996..90334fb0 100644
--- a/charmcraft/services/store.py
+++ b/charmcraft/services/store.py
@@ -21,6 +21,7 @@ from collections.abc import Collection, Mapping, Sequence
import craft_application
import craft_store
+from craft_cli impor... |
canonical__charmcraft-1744 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/extensions/gunicorn.py:_GunicornBase._get_root_snippet",
"charmcraft/extensions/gunicorn.py:FlaskFramework.get_parts_snippet"
],
"edited_modules": [
"charmcraft/ex... | canonical/charmcraft | ac08e98e5dd6d0764beba24275193004bdc3df2d | flask-framework charm builds failing due to dependency
### Bug Description
Building a flask-framework charm is now failing due to indirect rust-based dependency issues requiring a newer version of rust.
### To Reproduce
1. `charmcraft init --profile=flask-framework`
2. `charmcraft pack`
### Environment
Ubuntu 24.... | diff --git a/charmcraft/extensions/gunicorn.py b/charmcraft/extensions/gunicorn.py
index 23f78a9e..56ae3ce7 100644
--- a/charmcraft/extensions/gunicorn.py
+++ b/charmcraft/extensions/gunicorn.py
@@ -158,7 +158,13 @@ class _GunicornBase(Extension):
"grafana-dashboard": {"interface": "grafana_dashboard"}... |
canonical__charmcraft-1745 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/utils/file.py:build_zip"
],
"edited_modules": [
"charmcraft/utils/file.py:build_zip"
]
},
"file": "charmcraft/utils/file.py"
}
] | canonical/charmcraft | 51a55f7320370179bb48b4e5f6cd02a9de46cc13 | Charmcraft 3.x not including symlinked directories in resulting charm
### Bug Description
Building classical charms with version 3 is not adding the submodules like charmhelpers in the hooks folder.
So running a charm build with version 3 is breaking saying that it's not possible to find the module charmhelpers
##... | diff --git a/charmcraft/utils/file.py b/charmcraft/utils/file.py
index cb4d5be3..a88c7393 100644
--- a/charmcraft/utils/file.py
+++ b/charmcraft/utils/file.py
@@ -63,8 +63,9 @@ def build_zip(zip_path: PathOrString, prime_dir: PathOrString) -> None:
"""
zip_path = pathlib.Path(zip_path).resolve()
prime_di... |
canonical__charmcraft-1746 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/extensions/gunicorn.py:_GunicornBase._get_root_snippet",
"charmcraft/extensions/gunicorn.py:FlaskFramework.get_parts_snippet"
],
"edited_modules": [
"charmcraft/ex... | canonical/charmcraft | ac08e98e5dd6d0764beba24275193004bdc3df2d | FTBFS with reactive plugin, getting charmcraft internal error
### Bug Description
Buliding a charm with a reactive plugin results in an internal error on charmcraft 3
```
charmcraft internal error: ValidationError(model='CheckResult', errors=[{'loc': ('text',), 'msg': 'none is not an allowed value', 'type': 'type_... | diff --git a/charmcraft/extensions/gunicorn.py b/charmcraft/extensions/gunicorn.py
index 23f78a9e..56ae3ce7 100644
--- a/charmcraft/extensions/gunicorn.py
+++ b/charmcraft/extensions/gunicorn.py
@@ -158,7 +158,13 @@ class _GunicornBase(Extension):
"grafana-dashboard": {"interface": "grafana_dashboard"}... |
canonical__charmcraft-1759 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"charmcraft/models/metadata.py:CharmMetadata"
]
},
"file": "charmcraft/models/metadata.py"
}
] | canonical/charmcraft | 2d1e6d367ccf20a4debb0cbb3715c315dfcd390e | Max summary length is limited in metadata output
### Bug Description
This needs to become a str: https://github.com/canonical/charmcraft/blob/2d1e6d367ccf20a4debb0cbb3715c315dfcd390e/charmcraft/models/metadata.py#L42
### To Reproduce
https://github.com/canonical/metacontroller-operator/actions/runs/10074781102/job/2... | diff --git a/charmcraft/models/metadata.py b/charmcraft/models/metadata.py
index ba848618..567167c6 100644
--- a/charmcraft/models/metadata.py
+++ b/charmcraft/models/metadata.py
@@ -39,7 +39,7 @@ class CharmMetadata(models.BaseMetadata):
name: models.ProjectName
display_name: models.ProjectTitle | None = N... |
canonical__charmcraft-1763 | [
{
"changes": {
"added_entities": [
"charmcraft/services/provider.py:ProviderService.get_base"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"charmcraft/services/provider.py:ProviderService"
]
},
"file": "charmcraft/services/pro... | canonical/charmcraft | ff36d80d6bb160dec17cb6067c34fbb600b96798 | `CRAFT_SHARED_CACHE` broken or ignored in charmcraft 3.1
### Bug Description
`CRAFT_SHARED_CACHE` appears to be broken in charmcraft 3.1
charmcraft ignores wheels in `CRAFT_SHARED_CACHE` and doesn't appear to populate `CRAFT_SHARED_CACHE` after running a pack
### To Reproduce
Reproduce issue with `CRAFT_SHA... | diff --git a/charmcraft/services/provider.py b/charmcraft/services/provider.py
index 05be9b1b..910c4b4e 100644
--- a/charmcraft/services/provider.py
+++ b/charmcraft/services/provider.py
@@ -18,9 +18,13 @@
from __future__ import annotations
import os
+import pathlib
+import craft_providers
from craft_application... |
canonical__charmcraft-1818 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/commands/analyse.py:Analyse._run_streaming"
],
"edited_modules": [
"charmcraft/application/commands/analyse.py:Analyse"
]
},
"file": "charmcraft/... | canonical/charmcraft | c29dbccfa82989ba1bf97823e135bd590e125bb6 | Charmcraft 3 breaks charms with multiple run-on architectures
### Bug Description
For Jammy and below, charms with multiple `run-on` get the message `Architecture 'amd64-arm64-ppc64el-s390x' is not supported.` (or similar)
### To Reproduce
1. `git clone https://opendev.org/openstack/charm-vault.git`
2. `git s... | diff --git a/charmcraft/application/commands/analyse.py b/charmcraft/application/commands/analyse.py
index 6b92762e..8b160efe 100644
--- a/charmcraft/application/commands/analyse.py
+++ b/charmcraft/application/commands/analyse.py
@@ -85,8 +85,7 @@ class Analyse(base.CharmcraftCommand):
filepath, ignor... |
canonical__charmcraft-1823 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/commands/analyse.py:Analyse._run_streaming"
],
"edited_modules": [
"charmcraft/application/commands/analyse.py:Analyse"
]
},
"file": "charmcraft/... | canonical/charmcraft | c29dbccfa82989ba1bf97823e135bd590e125bb6 | Charmcraft pack does not work when updating to 3.1.1 on osx
### Bug Description
Running `charmcraft pack` fails on a charm that used to build perfectly. I just upgraded from charmcraft 2.6 to 3.1.1 and the error started coming up.
```
cannot inject snap 'charmcraft' from host on a non-linux system
install the sna... | diff --git a/charmcraft/application/commands/analyse.py b/charmcraft/application/commands/analyse.py
index 6b92762e..8b160efe 100644
--- a/charmcraft/application/commands/analyse.py
+++ b/charmcraft/application/commands/analyse.py
@@ -85,8 +85,7 @@ class Analyse(base.CharmcraftCommand):
filepath, ignor... |
canonical__charmcraft-1850 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/models/metadata.py:CharmMetadata.from_charm"
],
"edited_modules": [
"charmcraft/models/metadata.py:CharmMetadata"
]
},
"file": "charmcraft/models/metadata.py... | canonical/charmcraft | 4a3cbacbd5a1cae3cd1076e2ff8ba93f3e49f3e7 | Add `charm-user` key
### What needs to get done
Juju 3.6+ supports a `charm-user` key in `metadata.yaml`. We need to provide a way to generate that from charmcraft.yaml.
https://juju.is/docs/sdk/metadata-yaml#heading--charm-user
### Why it needs to get done
feature parity | diff --git a/charmcraft/models/metadata.py b/charmcraft/models/metadata.py
index 4133680d..13a6a498 100644
--- a/charmcraft/models/metadata.py
+++ b/charmcraft/models/metadata.py
@@ -19,6 +19,7 @@ from typing import TYPE_CHECKING, Any
import pydantic
from craft_application import models
+from craft_application.mode... |
canonical__charmcraft-1888 | [
{
"changes": {
"added_entities": [
"charmcraft/services/provider.py:ProviderService.__init__",
"charmcraft/services/provider.py:ProviderService.instance",
"charmcraft/services/provider.py:_maybe_lock_cache"
],
"added_modules": [
"charmcraft/services/provider.py:... | canonical/charmcraft | 358657b6fcfd5749e2b206dcd40ade8a58c1dad0 | Building multiple charms simultaneously can cause caching errors
### Bug Description
Using `charmcraft` from `latest/edge` in GH runners results in istio charms failing to be built. More specifically, this results in the [following zipfile bug](https://github.com/canonical/bundle-kubeflow/issues/1005). This used to ... | diff --git a/charmcraft/services/provider.py b/charmcraft/services/provider.py
index cefcb9ad..443e1fb8 100644
--- a/charmcraft/services/provider.py
+++ b/charmcraft/services/provider.py
@@ -17,19 +17,55 @@
"""Service class for creating providers."""
from __future__ import annotations
+import contextlib
+import io
... |
canonical__charmcraft-1891 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/charm_builder.py:CharmBuilder._install_dependencies"
],
"edited_modules": [
"charmcraft/charm_builder.py:CharmBuilder"
]
},
"file": "charmcraft/charm_builder... | canonical/charmcraft | 2fa3602fa2455c132418486ef35886d0201956f9 | Strict dependencies prevents charm from building
### Bug Description
`ModuleNotFoundError: No module named 'markupsafe'` when building charm with `charm-strict-dependencies: true`
### To Reproduce
```
git clone https://github.com/canonical/mysql-router-operator
git checkout with-hashes
tox run -e pack-wrapp... | diff --git a/charmcraft/charm_builder.py b/charmcraft/charm_builder.py
index 9bd53778..e7ac4434 100644
--- a/charmcraft/charm_builder.py
+++ b/charmcraft/charm_builder.py
@@ -247,7 +247,9 @@ class CharmBuilder:
# common charm dependencies (e.g. ops). Resolve this by updating to a
# known worki... |
canonical__charmcraft-1892 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/charm_builder.py:CharmBuilder._install_dependencies"
],
"edited_modules": [
"charmcraft/charm_builder.py:CharmBuilder"
]
},
"file": "charmcraft/charm_builder... | canonical/charmcraft | d2fcbfd55cce43aef5247ffa8af52ea6149dde44 | Strict dependencies prevents charm from building
### Bug Description
`ModuleNotFoundError: No module named 'markupsafe'` when building charm with `charm-strict-dependencies: true`
### To Reproduce
```
git clone https://github.com/canonical/mysql-router-operator
git checkout with-hashes
tox run -e pack-wrapp... | diff --git a/charmcraft/charm_builder.py b/charmcraft/charm_builder.py
index 40a0bb76..47bd9c94 100644
--- a/charmcraft/charm_builder.py
+++ b/charmcraft/charm_builder.py
@@ -243,6 +243,7 @@ class CharmBuilder:
[
pip_cmd,
"install",
+ ... |
canonical__charmcraft-1968 | [
{
"changes": {
"added_entities": [
"charmcraft/linters.py:PipCheck.run"
],
"added_modules": [
"charmcraft/linters.py:PipCheck"
],
"edited_entities": null,
"edited_modules": null
},
"file": "charmcraft/linters.py"
},
{
"changes": {
"added_... | canonical/charmcraft | 408650c8c26fa6b6d6aa74966e8e6a5b532d89d1 | `python` and `poetry` plugins include `lib64` symlink as a second copy of the venv
### Bug Description
When using the `python` or `poetry` plugin, a second copy of the `lib` directory is created in `lib64` because it's a symlink. The charm works fine without that symlink, so we should just remove `lib64` if it's a sym... | diff --git a/charmcraft/linters.py b/charmcraft/linters.py
index c8d50392..40e639ca 100644
--- a/charmcraft/linters.py
+++ b/charmcraft/linters.py
@@ -1,4 +1,4 @@
-# Copyright 2021-2022 Canonical Ltd.
+# Copyright 2021-2024 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... |
canonical__charmcraft-2034 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/services/store.py:StoreService.get_libraries_metadata"
],
"edited_modules": [
"charmcraft/services/store.py:StoreService"
]
},
"file": "charmcraft/services/s... | canonical/charmcraft | e02547e7ecc5ee4a8e4b6949f14ed49168364a8e | `fetch-libs` has weird error messages when libs aren't available
### Bug Description
Example: https://github.com/canonical/charmcraft/actions/runs/10049710901/job/27776909923#step:5:1228
When libraries aren't available from charmhub, `fetch-libs` doesn't always respond with a valid error message.
### To Reproduce
... | diff --git a/.github/workflows/spread-large.yaml b/.github/workflows/spread-large.yaml
index f1ef4f14..9f971ba1 100644
--- a/.github/workflows/spread-large.yaml
+++ b/.github/workflows/spread-large.yaml
@@ -6,31 +6,19 @@ on:
workflow_dispatch:
+ # If we're editing this file, run it on the pull request.
+ pull_... |
canonical__charmcraft-2042 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/commands/store.py:PublishLibCommand.run"
],
"edited_modules": [
"charmcraft/application/commands/store.py:PublishLibCommand"
]
},
"file": "charmc... | canonical/charmcraft | 0977fbf449d46accb75838b11db8590eb6f2b8de | `charmcraft publish-lib` exits with 0 even if publishing fails
### Bug Description
Currently `charmcraft publish-lib` correctly fails the library push if something's wrong with LIBPATCH (e.g., LIBPATCH is not bumped, going back, etc). However, the exit of the command is always `0`.
This is a problem especially i... | diff --git a/charmcraft/application/commands/store.py b/charmcraft/application/commands/store.py
index 8515c306..80c7c1d4 100644
--- a/charmcraft/application/commands/store.py
+++ b/charmcraft/application/commands/store.py
@@ -1539,6 +1539,7 @@ class PublishLibCommand(CharmcraftCommand):
analysis.append((l... |
canonical__charmcraft-2054 | [
{
"changes": {
"added_entities": [
"charmcraft/models/project.py:CharmcraftBuildPlanner._populate_platforms",
"charmcraft/models/project.py:PlatformCharm._populate_platforms"
],
"added_modules": null,
"edited_entities": [
"charmcraft/models/project.py:CharmcraftBu... | canonical/charmcraft | d6ae069240e3383698db29f0b8d0948241ab22d0 | Unable to build multi-base subordinate charms on 24.04
### Bug Description
Subordinate charms use the base of the principal charm. Therefore, subordinate charms such as MySQL Router need to support multiple bases, since we can't enforce the principal charm to use a particular base. Currently MySQL Router supports 20.0... | diff --git a/charmcraft/models/project.py b/charmcraft/models/project.py
index 119fc2e6..fc059756 100644
--- a/charmcraft/models/project.py
+++ b/charmcraft/models/project.py
@@ -38,7 +38,7 @@ from craft_cli import CraftError, emit
from craft_platforms import charm
from craft_providers import bases
from pydantic imp... |
canonical__charmcraft-2060 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/services/package.py:PackageService.get_charm_path"
],
"edited_modules": [
"charmcraft/services/package.py:PackageService"
]
},
"file": "charmcraft/services/p... | canonical/charmcraft | 6d0d9ce4d7656fe77df8b322f30c892ef212862a | Multi-base charm cannot be uploaded to GitHub Actions artifact
### Bug Description
Packing a charm with
```yaml
platforms:
ubuntu@22.04:amd64:
```
creates a *.charm file that contains the `:` character (e.g. `mysql-router-k8s_ubuntu@22.04:amd64.charm`), which cannot be uploaded as a GitHub Actions artifact or... | diff --git a/charmcraft/services/package.py b/charmcraft/services/package.py
index fd0d314f..74206b30 100644
--- a/charmcraft/services/package.py
+++ b/charmcraft/services/package.py
@@ -28,9 +28,8 @@ from typing import TYPE_CHECKING, cast
import craft_application
import craft_platforms
import yaml
-from craft_appli... |
canonical__charmcraft-2084 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/commands/store.py:FetchLibCommand.run"
],
"edited_modules": [
"charmcraft/application/commands/store.py:FetchLibCommand"
]
},
"file": "charmcraft... | canonical/charmcraft | 0ab0cc25005a65cad2f00f37e925cdae6d9398a7 | fetch-lib error is useless/misleading
### Bug Description
If I try to import a lib that doesn't exist, I get this:
```
Store operation failed:
- None: Items need to include 'library_id' or 'package_id'
Full execution log: ...
```
I can't figure out how to include a `library_id` or a `package_id` into the r... | diff --git a/charmcraft/application/commands/store.py b/charmcraft/application/commands/store.py
index 04700b6b..0d0918ff 100644
--- a/charmcraft/application/commands/store.py
+++ b/charmcraft/application/commands/store.py
@@ -1630,18 +1630,20 @@ class FetchLibCommand(CharmcraftCommand):
# get tips from the ... |
canonical__charmcraft-2106 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/application/commands/store.py:PublishLibCommand.run"
],
"edited_modules": [
"charmcraft/application/commands/store.py:PublishLibCommand"
]
},
"file": "charmc... | canonical/charmcraft | 389f8ca582592c9a65a19ffa0d522a677174f094 | `charmcraft publish-lib` exits with 0 even if publishing fails
### Bug Description
Currently `charmcraft publish-lib` correctly fails the library push if something's wrong with LIBPATCH (e.g., LIBPATCH is not bumped, going back, etc). However, the exit of the command is always `0`.
This is a problem especially i... | diff --git a/charmcraft/application/commands/store.py b/charmcraft/application/commands/store.py
index 04700b6b..84e5c96a 100644
--- a/charmcraft/application/commands/store.py
+++ b/charmcraft/application/commands/store.py
@@ -1491,6 +1491,7 @@ class PublishLibCommand(CharmcraftCommand):
to_query = [{"lib_id":... |
canonical__charmcraft-684 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:UploadCommand.fill_parser",
"charmcraft/commands/store/__init__.py:UploadCommand.run"
],
"edited_modules": [
"charmcraft/commands/store/... | canonical/charmcraft | 43241f1e12adda17c61245c6c6ed93e354b8e932 | Add a --name parameter to upload command (to use a different name than the specified in metadata.yaml)
With the recent transition of the old charm store to charmhub all charm uploads now need to be handled. In our case charms are available to our customers through the old charm store URLs (e.g. `cs:~anbox-charmers/ams`... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index 186665ca..cd187442 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -472,6 +472,11 @@ class UploadCommand(BaseCommand):
action="append",
help="The c... |
canonical__charmcraft-698 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:_get_lib_info"
],
"edited_modules": [
"charmcraft/commands/store/__init__.py:_get_lib_info"
]
},
"file": "charmcraft/commands/stor... | canonical/charmcraft | e0b3280684d8ab96959f0b96190e42a2f26a061a | Running `charmcraft fetch-lib` on a charm with dashes should fetch to a path with underscores
If you have a library for a charm (such as nginx-ingress-integrator) that has dashes in the name, and run `charmcraft fetch-lib charms.nginx-ingress-integrator.v0.charms` it should still fetch to a path on disk that has unders... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index cd187442..e1589462 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -922,9 +922,13 @@ def _get_lib_info(*, full_name=None, lib_path=None):
# dir and Python extension... |
canonical__charmcraft-755 | [
{
"changes": {
"added_entities": [
"charmcraft/linters.py:JujuMetadata.__init__"
],
"added_modules": null,
"edited_entities": [
"charmcraft/linters.py:JujuMetadata.run"
],
"edited_modules": [
"charmcraft/linters.py:JujuMetadata"
]
},
"fil... | canonical/charmcraft | 44df2fd7b8fed0849bcdb02421f259e7a1c5780e | All linters should produce an error text in function to what they found
If the linter finds a problem in a file, the error text should not be static (JujuMetadata currently only produces `Problems found with metadata.yaml file.`) but dinamically according to what the problem is. | diff --git a/charmcraft/linters.py b/charmcraft/linters.py
index 86c28db8..8c008dad 100644
--- a/charmcraft/linters.py
+++ b/charmcraft/linters.py
@@ -1,4 +1,4 @@
-# Copyright 2021 Canonical Ltd.
+# Copyright 2021-2022 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not u... |
canonical__charmcraft-767 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/build.py:Builder._handle_deprecated_cli_arguments"
],
"edited_modules": [
"charmcraft/commands/build.py:Builder"
]
},
"file": "charmcraft/commands/b... | canonical/charmcraft | 1c6b62dc96594a8aedc334770352fb9856d50ad0 | The `pack` command does not validate the entrypoint unless it's specified
If `pack` is run without using the `--entrypoint` option, even if it defaults to `src/charm.py`, it's not running any validation on it (e.g. that is executable). | diff --git a/charmcraft/commands/build.py b/charmcraft/commands/build.py
index e00ea4a9..e75c9bba 100644
--- a/charmcraft/commands/build.py
+++ b/charmcraft/commands/build.py
@@ -240,13 +240,28 @@ class Builder:
"--entrypoint not supported when charm-entrypoint "
"specified in ... |
canonical__charmcraft-784 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:ListResourcesCommand.fill_parser",
"charmcraft/commands/store/__init__.py:ListResourcesCommand.run",
"charmcraft/commands/store/__init__.py:UploadRe... | canonical/charmcraft | 9150bf310d9676d7047b1303177fbd8c4e1c766c | approach for using store commands programmatically
Hello,
We are trying to create some release infrastructure to help us automate releasing charms to the store. Is anyone currently using store commands programmatically? It seems we currently need to auth against the ubuntu one from the browser. Is there a way to d... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index 9102dcc5..bb4e7849 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -1650,12 +1650,27 @@ class ListResourcesCommand(BaseCommand):
def fill_parser(self, parser):
... |
canonical__charmcraft-787 | [
{
"changes": {
"added_entities": [
"charmcraft/main.py:_emit_error"
],
"added_modules": [
"charmcraft/main.py:_emit_error"
],
"edited_entities": [
"charmcraft/main.py:main"
],
"edited_modules": [
"charmcraft/main.py:main"
]
},
... | canonical/charmcraft | f58b5ac4c2b8667eacef5861a80fe693ad58d345 | Stop "internal Charmcraft" leaking log in the container
When running `pack` in normal mode (using a container, not destructive mode), and it ends in error, the Charmcraft process run inside the container exposes the problem and where the log is. And it shouldn't expose the internal log.
For example, this is a comple... | diff --git a/charmcraft/main.py b/charmcraft/main.py
index 49987e9c..70ef3b82 100644
--- a/charmcraft/main.py
+++ b/charmcraft/main.py
@@ -116,6 +116,20 @@ def _get_system_details():
return f"System details: {os_platform}; Environment: {env_string}"
+def _emit_error(error, cause=None):
+ """Emit the error i... |
canonical__charmcraft-791 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/config.py:Config.unmarshal"
],
"edited_modules": [
"charmcraft/config.py:Config"
]
},
"file": "charmcraft/config.py"
},
{
"changes": {
"added_e... | canonical/charmcraft | ebf0e858d1dc671e941015f661c49a6368315fdb | Enforce deprecation DN03: Bases configuration is now required
See [the Deprecations page](https://juju.is/docs/sdk/charmcraft-deprecations) for more info. | diff --git a/charmcraft/config.py b/charmcraft/config.py
index e50ec066..3f53d864 100644
--- a/charmcraft/config.py
+++ b/charmcraft/config.py
@@ -73,7 +73,6 @@ from typing import Any, Dict, List, Optional, Tuple
import pydantic
from craft_cli import CraftError
-from charmcraft.deprecations import notify_deprecatio... |
canonical__charmcraft-797 | [
{
"changes": {
"added_entities": [
"charmcraft/commands/build.py:Builder._pre_lifecycle_validation"
],
"added_modules": null,
"edited_entities": [
"charmcraft/commands/build.py:Builder.__init__",
"charmcraft/commands/build.py:Builder.build_charm",
"charmcr... | canonical/charmcraft | aa51786b06d5ef81ae3a757eb84fe4b7e767c6a8 | Enforce deprecation DN05: Use charm-requirements in charmcraft.yaml parts to define requirements
See [the Deprecations page](https://juju.is/docs/sdk/charmcraft-deprecations) for more info.
| diff --git a/charmcraft/commands/build.py b/charmcraft/commands/build.py
index 1332333c..b96cfe0c 100644
--- a/charmcraft/commands/build.py
+++ b/charmcraft/commands/build.py
@@ -96,7 +96,6 @@ class Builder:
def __init__(self, args, config):
self.charmdir = args["from"]
- self.requirement_paths =... |
canonical__charmcraft-802 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:StatusCommand.run"
],
"edited_modules": [
"charmcraft/commands/store/__init__.py:StatusCommand"
]
},
"file": "charmcraft/commands/... | canonical/charmcraft | 46cd23688b8d4ad0589ca95a987d597689d7b84d | Update `charmcraft status charmname --format json` output terminology
An example (truncated) output from `charmcraft status metacontroller-operator --format json` is given by:
```
charmcraft status metacontroller-operator --format json
[
{
"track": "latest",
"channels": [ ... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index bb4e7849..5ae755bc 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -896,7 +896,7 @@ class StatusCommand(BaseCommand):
unreleased_track = {None: {}} # base in None ... |
canonical__charmcraft-866 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/reactive_plugin.py:ReactivePluginEnvironmentValidator.validate_environment"
],
"edited_modules": [
"charmcraft/reactive_plugin.py:ReactivePluginEnvironmentValidator"
... | canonical/charmcraft | 7790c04425256960b954ec62747154f69402ec8a | reactive plugin charm tools version validation code is britle
The charm tools may soon remove the now redundant legacy charm store code, when that happens the output from the version command may no longer use the format expected here:
https://github.com/canonical/charmcraft/blob/dbf82a0fbaa6633248bb213d3943603c1e7c50a... | diff --git a/charmcraft/reactive_plugin.py b/charmcraft/reactive_plugin.py
index bc50b20f..337ac493 100644
--- a/charmcraft/reactive_plugin.py
+++ b/charmcraft/reactive_plugin.py
@@ -14,6 +14,7 @@
"""Charmcraft's reactive plugin for craft-parts."""
+import json
import shlex
import subprocess
import sys
@@ -61,1... |
canonical__charmcraft-869 | [
{
"changes": {
"added_entities": [
"charmcraft/reactive_plugin.py:run_charm_tool"
],
"added_modules": [
"charmcraft/reactive_plugin.py:run_charm_tool"
],
"edited_entities": [
"charmcraft/reactive_plugin.py:ReactivePluginEnvironmentValidator.validate_environm... | canonical/charmcraft | a95394f28ff6c0b974d39baa44f6d34530fd6a5f | The reactive plugin is not correctly checking if `charm` failed
The `charm` tool used by the reactive plugin has a complex return code specification.
While Charmcraft is correctly checking that the return code >= 200 is an error, it's failing to verify that <0 is also an error.
Furthermore, it should log in debug... | diff --git a/charmcraft/reactive_plugin.py b/charmcraft/reactive_plugin.py
index 5dcc4c3e..350dcb39 100644
--- a/charmcraft/reactive_plugin.py
+++ b/charmcraft/reactive_plugin.py
@@ -21,7 +21,6 @@ import sys
from pathlib import Path
from typing import Any, Dict, List, Optional, Set, cast
-from craft_cli import emit... |
canonical__charmcraft-871 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:UploadResourceCommand.fill_parser",
"charmcraft/commands/store/__init__.py:UploadResourceCommand.run"
],
"edited_modules": [
"charmcraft... | canonical/charmcraft | ecce30c69d0912db209d060b19b6dd34f971bb7c | The upload-resource command should accept images id or digests
(all this is for OCI images, file resources are fine)
Currently is mixed: accepts "ids" (and no point in checking remotely in that case) but the docs say "digest".
It should:
- accept "id" or digest, these two should be fine: `charmcraft upload-res... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index bd987380..26ab8dd4 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -44,7 +44,7 @@ from charmcraft.utils import (
)
from .store import Store
-from .registry import ImageH... |
canonical__charmcraft-903 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:ListNamesCommand.run",
"charmcraft/commands/store/__init__.py:ListNamesCommand.fill_parser"
],
"edited_modules": [
"charmcraft/commands/... | canonical/charmcraft | 96308c3ebaf7e27e3a5b9ac83b5a96f10b282c2a | The `names` command should allow listing those "collaborated" charms
Currently it only lists those charms *owned* by the developer.
We could add an `--include-collaborations` option (or something shorter, but remember we have bash autocompletion, so...) to also list the charms where the developer is a collaborator.... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index 26ab8dd4..cbccb213 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -401,6 +401,10 @@ class ListNamesCommand(BaseCommand):
seen by any user, while `private` items ar... |
canonical__charmcraft-915 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/__init__.py:StatusCommand.run"
],
"edited_modules": [
"charmcraft/commands/store/__init__.py:StatusCommand"
]
},
"file": "charmcraft/commands/... | canonical/charmcraft | e5ac156c3ae6d335cb78b4494f3dac8386bd2798 | The Status command confuses branches between architectures
When the charm is multi-architecture, and a branch is created, e.g.
```
charmcraft release testfacu-charm -r 1 --channel=edge/branch123
```
...there will be a branch for each architecture. Example of the channel map (after also releasing just to `edge`):
`... | diff --git a/charmcraft/commands/store/__init__.py b/charmcraft/commands/store/__init__.py
index cbccb213..b964d1d4 100644
--- a/charmcraft/commands/store/__init__.py
+++ b/charmcraft/commands/store/__init__.py
@@ -878,7 +878,10 @@ class StatusCommand(BaseCommand):
per_track = {}
branch_present = Fals... |
canonical__charmcraft-916 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/commands/store/store.py:Store.login"
],
"edited_modules": [
"charmcraft/commands/store/store.py:Store"
]
},
"file": "charmcraft/commands/store/store.py"
}
... | canonical/charmcraft | cad2b5739b7c4ba8761554e17097a90a498cf3f5 | Provide a better error description and suggest solution for the "double login" case
Craft Store does not allow to "login" if it finds credentials in the keyring. Currently the received error is confusing:
```
craft-store error: Credentials found for 'charmcraft' on 'api.charmhub.io'.
```
Furthermore, ... | diff --git a/charmcraft/commands/store/store.py b/charmcraft/commands/store/store.py
index dd6fe745..6dc7f067 100644
--- a/charmcraft/commands/store/store.py
+++ b/charmcraft/commands/store/store.py
@@ -25,6 +25,7 @@ from functools import wraps
import craft_store
from craft_cli import emit, CraftError
from craft_sto... |
canonical__charmcraft-917 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"charmcraft/main.py:_get_system_details"
],
"edited_modules": [
"charmcraft/main.py:_get_system_details"
]
},
"file": "charmcraft/main.py"
}
] | canonical/charmcraft | 754050ef4091ed4f1aeaf58934850deb50d046aa | The presence of CHARMCRAFT_AUTH should be logged
Currently we're logging all CHARMCRAFT_* environment variables, but specifically excluding `CHARMCRAFT_AUTH` to not leak secrets.
However, it's very useful, for debugging purposes, know that `CHARMCRAFT_AUTH` is present or not, so we should log it with a different val... | diff --git a/charmcraft/main.py b/charmcraft/main.py
index 716cc14a..bf24e730 100644
--- a/charmcraft/main.py
+++ b/charmcraft/main.py
@@ -102,16 +102,20 @@ EXTRA_ENVIRONMENT = ("DESKTOP_SESSION", "XDG_CURRENT_DESKTOP")
def _get_system_details():
"""Produce details about the system."""
- # prepare the useful... |
canonical__operator-1000 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:Secret.get_content"
],
"edited_modules": [
"ops/model.py:Secret"
]
},
"file": "ops/model.py"
}
] | canonical/operator | c9bba5b00bc99cab1c679dfd0814c1f2d0294b5c | secret.get_content() un-intuitively cached locally
"Screenshot" from a debugger session.
As you can see, I'm fetching contents of a secret, saving it to `dict` called `full_content`.
Then I update `full_content`. NOT the secret, but the dictionary holding the output of the `get_content()` call.
Yet, when I call `sec... | diff --git a/ops/model.py b/ops/model.py
index 24f40f5..906b463 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -1181,6 +1181,9 @@ class Secret:
def get_content(self, *, refresh: bool = False) -> Dict[str, str]:
"""Get the secret's content.
+ Returns:
+ A copy of the secret's content d... |
canonical__operator-1005 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "ops/__init__.py"
},
{
"changes": {
"added_entities": [
"ops/model.py:Unit.set_ports"
],
"added_modules": [
"ops/mode... | canonical/operator | e054c3fdad20030666ab1759501873fd99f67143 | Add method for "wholesale" port management
#905 added convenient API for "deltas" in port management, and it works well:
```python
def set_ports(self):
"""Open necessary (and close no longer needed) workload ports."""
planned_ports = {
OpenedPort("tcp", self._ports.api),
... | diff --git a/ops/__init__.py b/ops/__init__.py
index 1d6e383..bb900bf 100644
--- a/ops/__init__.py
+++ b/ops/__init__.py
@@ -138,6 +138,7 @@ __all__ = [
'Network',
'NetworkInterface',
'OpenedPort',
+ 'Port',
'Pod',
'Relation',
'RelationData',
@@ -272,6 +273,7 @@ from .model import ( # ... |
canonical__operator-1024 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:Container.push_path",
"ops/model.py:Container.pull_path",
"ops/model.py:Container._list_recursive"
],
"edited_modules": [
"ops/model.py:Container"
... | canonical/operator | c22c807440f2dfc449e99dd29b6f4101b8a0ffd6 | pull_path doesn't retrieve empty directories
Per [this comment](https://github.com/canonical/operator/pull/960#issuecomment-1628001631), `Container.pull_path` doesn't retrieve empty directories. This seems like a bug, not a feature (Git's behaviour notwithstanding). From a quick look at the code, I think `push_path` wi... | diff --git a/ops/model.py b/ops/model.py
index 1d88eaa..cd1733e 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -2275,6 +2275,9 @@ class Container:
try:
for info in Container._list_recursive(local_list, source_path):
dstpath = self._build_destpath(info.path, source_pat... |
canonical__operator-1038 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/charm.py:RelationMeta.__init__"
],
"edited_modules": [
"ops/charm.py:RelationMeta"
]
},
"file": "ops/charm.py"
}
] | canonical/operator | a55a07ac3bbda5bfb4228ad8d2a7904b2482ed1f | Optional parameter not saved in RelationMeta class
Charm authors can mark some of the relations as optional using 'optional' attribute in relations section (provides/requires/peers) in metadata.yaml [1], however the parameter is not saved in RelationMeta class.
The operator charms can perform some actions like updat... | diff --git a/ops/charm.py b/ops/charm.py
index e2b39fa..77a1f0b 100755
--- a/ops/charm.py
+++ b/ops/charm.py
@@ -52,6 +52,7 @@ if TYPE_CHECKING:
'_RelationMetaDict', {
'interface': Required[str],
'limit': int,
+ 'optional': bool,
'scope': _Scopes},
tot... |
canonical__operator-1041 | [
{
"changes": {
"added_entities": [
"ops/model.py:Unit.reboot",
"ops/model.py:_ModelBackend.reboot"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"ops/model.py:Unit",
"ops/model.py:_ModelBackend"
]
},
"file": "op... | canonical/operator | 609b05b4ee009fff24e6b9c01b84690f7a11c93c | No interface to `juju-reboot` hook tool in ops
Hello there! I am currently working through a predicament in the [SLURM charms](https://charmhub.io/?q=slurm) where the machines need to be rebooted after package installation to apply security updates. Originally, the SLURM charms were deployed manually so the human opera... | diff --git a/CHANGES.md b/CHANGES.md
index cc12ba4..6b42007 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,9 @@
# 2.8.0
+* Added `Unit.reboot()` and `Harness.reboot_count``
+* Added `RelationMeta.optional`
* The type of a `Handle`'s `key` was expanded from `str` to `str|None`
+* Narrowed types of `app` and `un... |
canonical__operator-1049 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/pebble.py:Client._request_raw"
],
"edited_modules": [
"ops/pebble.py:Client"
]
},
"file": "ops/pebble.py"
}
] | canonical/operator | 959009081a4c6a1b0628b98d758796d47a64cd55 | Better Error Handling if the pebble socket goes missing
On a Microk8s cloud there were some issues causing containers to get restarted. Because containers were getting rescheduled, it ended up that during the time that a charm hook was firing, it ultimately failed to stay connected to pebble. The error message that yo... | diff --git a/ops/pebble.py b/ops/pebble.py
index 3654185..80ce8f6 100644
--- a/ops/pebble.py
+++ b/ops/pebble.py
@@ -1623,6 +1623,10 @@ class Client:
message = f'{type(e2).__name__} - {e2}'
raise APIError(body, code, status, message)
except urllib.error.URLError as e:
+ ... |
canonical__operator-1057 | [
{
"changes": {
"added_entities": [
"ops/storage.py:SQLiteStorage._ensure_db_permissions"
],
"added_modules": null,
"edited_entities": [
"ops/storage.py:SQLiteStorage.__init__"
],
"edited_modules": [
"ops/storage.py:SQLiteStorage"
]
},
"fi... | canonical/operator | d1941e136e7e28d6d4ce1b69e374803acb89b1b7 | .unit-state.db is world-readable
.unit-state.db created by an operator framework charm is visible by any user in the system. The permission should be tighten up.
This is one example of charms that saved a private key for a TLS certificate.
```
$ sudo -u nobody strings /var/lib/juju/agents/unit-ceph-dashboard-1/cha... | diff --git a/ops/storage.py b/ops/storage.py
index 5dda21d..9f259f4 100644
--- a/ops/storage.py
+++ b/ops/storage.py
@@ -18,6 +18,7 @@ import os
import pickle
import shutil
import sqlite3
+import stat
import subprocess
from datetime import timedelta
from pathlib import Path
@@ -59,11 +60,29 @@ class SQLiteStorage... |
canonical__operator-1087 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/log.py:setup_root_logging"
],
"edited_modules": [
"ops/log.py:setup_root_logging"
]
},
"file": "ops/log.py"
},
{
"changes": {
"added_entities": null,
... | canonical/operator | 95e325ef137659c7a7cf1152a05dcc06383f3b2d | Actions: errors are captured to debug-log and are not in stderr
Setting stdout, stderr in event.set_results, always ends up with a failed action, but it never explains why it failed.
Consider the following charm:
```python
import logging
import ops
# Log messages can be retrieved using juju debug-log
logg... | diff --git a/ops/log.py b/ops/log.py
index e167c6d..d64aa4a 100644
--- a/ops/log.py
+++ b/ops/log.py
@@ -38,7 +38,8 @@ class JujuLogHandler(logging.Handler):
self.model_backend.juju_log(record.levelname, self.format(record))
-def setup_root_logging(model_backend: _ModelBackend, debug: bool = False):
+def s... |
canonical__operator-1091 | [
{
"changes": {
"added_entities": [
"ops/main.py:_get_juju_relation_id"
],
"added_modules": [
"ops/main.py:_get_juju_relation_id"
],
"edited_entities": [
"ops/main.py:_get_event_args",
"ops/main.py:main"
],
"edited_modules": [
"ops... | canonical/operator | ea1cf19f7352c65804c24eafdd68ae250f714ab6 | Add Relation.broken to allow querying if a relation is broken (breaking)
It's sometimes good to be able to query for relations and then determine if the relation you're looking at is broken (due to the current event being a relation-broken event for the relation in question, or while handling deferred events before tha... | diff --git a/CHANGES.md b/CHANGES.md
index 5be0036..a26f33c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,7 @@
# 2.10.0
* Added support for Pebble Notices (`PebbleCustomNoticeEvent`, `get_notices`, and so on)
+* Added `Relation.active`, and excluded inactive relations from `Model.relations`
# 2.9.0
diff ... |
canonical__operator-1106 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "docs/conf.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null... | canonical/operator | 41a4ad4e1fca0f5de2b09bd2ed1256f254898ef1 | CharmMeta class needs to be updated for Metadata v2
The `CharmMeta` class currently only represents the v1 Metadata spec - it needs to be updated to support metadata v2: https://discourse.charmhub.io/t/charm-metadata-v2/3674
| diff --git a/CHANGES.md b/CHANGES.md
index a26f33c..c0049d3 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,6 +2,8 @@
* Added support for Pebble Notices (`PebbleCustomNoticeEvent`, `get_notices`, and so on)
* Added `Relation.active`, and excluded inactive relations from `Model.relations`
+* Added full support for ch... |
canonical__operator-1124 | [
{
"changes": {
"added_entities": [
"ops/charm.py:ActionEvent.__init__",
"ops/charm.py:ActionEvent.snapshot"
],
"added_modules": null,
"edited_entities": [
"ops/charm.py:ActionEvent.restore"
],
"edited_modules": [
"ops/charm.py:ActionEvent"
... | canonical/operator | 2f304d3af048edd758bee8b4b4d59f474b33a286 | expose JUJU_ACTION_UUID envvar
Some old hooks-based charms use the JUJU_ACTION_UUID envvar.
When porting them to use ops, it would be nice if there was an opsy way to access its value.
How about adding an `ActionEvent.uuid -> int` property to fetch it?
| diff --git a/CHANGES.md b/CHANGES.md
index c0049d3..07774d9 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,7 @@
+# 2.11.0
+
+* Added `ActionEvent.id`, exposing the JUJU_ACTION_UUID environment variable.
+
# 2.10.0
* Added support for Pebble Notices (`PebbleCustomNoticeEvent`, `get_notices`, and so on)
diff --g... |
canonical__operator-1150 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/charm.py:StorageMeta.__init__"
],
"edited_modules": [
"ops/charm.py:StorageMeta"
]
},
"file": "ops/charm.py"
}
] | canonical/operator | 5804652253926fea5c2aae5952d3032cea12ca5f | Using Harness.add_storage(..., attach=True) before begin_with_initial_hooks gives confusing error
For example:
```python
import ops
import ops.testing
class MyCharm(ops.CharmBase):
pass
meta = """
containers:
test-container:
mounts:
... | diff --git a/ops/charm.py b/ops/charm.py
index 59ad4c5..eae71a2 100644
--- a/ops/charm.py
+++ b/ops/charm.py
@@ -1540,7 +1540,9 @@ class StorageMeta:
self.multiple_range = None
if 'multiple' in raw:
range = raw['multiple']['range']
- if '-' not in range:
+ if range[-... |
canonical__operator-1156 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:RelationMapping._get_unique",
"ops/model.py:_ModelBackend._validate_relation_access"
],
"edited_modules": [
"ops/model.py:RelationMapping",
"ops/model.py... | canonical/operator | 8097cca861eae31727636f92c932738d14d0ac81 | Harness and Juju behave differently when using model.get_relation in leader-elected
In the `leader-elected` hook, trying to get a relation fails with an error when using Harness, but works (returning `None`) with Juju. For example, with this charm:
```yaml
requires:
nonoptrel:
interface: foo
... | diff --git a/ops/model.py b/ops/model.py
index 9ccadcd..d028feb 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -45,7 +45,6 @@ from typing import (
Mapping,
MutableMapping,
Optional,
- Sequence,
Set,
TextIO,
Tuple,
@@ -880,8 +879,6 @@ class RelationMapping(Mapping[str, List['Relation']]... |
canonical__operator-1268 | [
{
"changes": {
"added_entities": [
"ops/pebble.py:Check._merge_exec",
"ops/pebble.py:Check._merge_http",
"ops/pebble.py:Check._merge_tcp",
"ops/pebble.py:Check._merge",
"ops/pebble.py:LogTarget._merge"
],
"added_modules": null,
"edited_entities": [... | canonical/operator | 2e1dbd99fd9ce1ce4c608d7c90a77c62e6bfe9ca | Combine Pebble layers in testing get_plan; merge "checks" and "log-targets"
As I discovered when reviewing https://github.com/canonical/operator/pull/1111 ([comment](https://github.com/canonical/operator/pull/1111#discussion_r1463868110)), we don't combine layers properly in the `_TestingPebbleClient.get_plan` result.
... | diff --git a/ops/pebble.py b/ops/pebble.py
index bc4c032..7497114 100644
--- a/ops/pebble.py
+++ b/ops/pebble.py
@@ -1135,6 +1135,73 @@ class Check:
else:
return NotImplemented
+ def _merge_exec(self, other: 'ExecDict') -> None:
+ """Merges this exec object with another exec definition... |
canonical__operator-1317 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:SecretInfo.from_dict"
],
"edited_modules": [
"ops/model.py:SecretInfo"
]
},
"file": "ops/model.py"
}
] | canonical/operator | 449793f9867eba11dc2e7e1c28ea3dca1e1da231 | Juju secret expiry is null
## Description
We have a charm that creates a secret with an expiry date on a given event and reads that secret on another event. During that second event, the expiry shows up as None when we would have expected it to be the value we initially set it to.
### Example charm
In this ex... | diff --git a/ops/model.py b/ops/model.py
index 3a9a1cf..f801a5b 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -1182,7 +1182,7 @@ class SecretInfo:
@classmethod
def from_dict(cls, id: str, d: Dict[str, Any]) -> 'SecretInfo':
"""Create new SecretInfo object from ID and dict parsed from JSON."""
- ... |
canonical__operator-1338 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:SecretInfo.__init__",
"ops/model.py:SecretInfo.from_dict",
"ops/model.py:SecretInfo.__repr__"
],
"edited_modules": [
"ops/model.py:SecretInfo"
]
... | canonical/operator | 3677507a2fd94e45eeb2e88e79e217490ae2ed51 | Expose "description" in SecretInfo
The `SecretInfo` that's returned from `Secret.get_info()` does not include the `description` field. This is included in `secret-info-get` - we're just ignoring it at the moment. It is possible to set the description in `Secret.set_info()` - it seems reasonable that charms should be ab... | diff --git a/ops/model.py b/ops/model.py
index 3b9c4d8..434c0e2 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -1181,6 +1181,7 @@ class SecretInfo:
expires: Optional[datetime.datetime],
rotation: Optional[SecretRotate],
rotates: Optional[datetime.datetime],
+ description: Optional[str... |
canonical__operator-1342 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/framework.py:ObjectEvents.events"
],
"edited_modules": [
"ops/framework.py:ObjectEvents"
]
},
"file": "ops/framework.py"
},
{
"changes": {
"added_enti... | canonical/operator | 3677507a2fd94e45eeb2e88e79e217490ae2ed51 | `Framework.ObjectEvents.events` has wrong signature
The signature of the `.events()` method is:
```python
def events(self) -> Dict[str, EventSource]:
"""Return a mapping of event_kinds to bound_events for [...]
```
so what is it, EventSource or bound_events?
Turns out in practice it is a mapping o... | diff --git a/ops/framework.py b/ops/framework.py
index 7c96ee5..c47e6b9 100644
--- a/ops/framework.py
+++ b/ops/framework.py
@@ -485,7 +485,7 @@ class ObjectEvents(Object):
event_kinds.append(attr_name)
return event_kinds
- def events(self) -> Dict[str, EventSource]:
+ def events(self)... |
canonical__operator-1358 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:Model.get_secret",
"ops/model.py:SecretInfo.__init__",
"ops/model.py:SecretInfo.from_dict",
"ops/model.py:Secret.__init__",
"ops/model.py:Secret._canonicaliz... | canonical/operator | cdfd10f34f2d8338fb18dea1185cdd70ea082252 | Ensure Secret.id includes model UUID
Currently `Secret._canonicalize_id` adds the `secret:` prefix if it's not there, but it doesn't add the model UUID. It would be helpful if it added the model UUID too, especially for cross-model relations. See more information at https://bugs.launchpad.net/juju/+bug/2075153
```py... | diff --git a/.github/workflows/tiobe.yaml b/.github/workflows/tiobe.yaml
index 6456792..6c79c22 100644
--- a/.github/workflows/tiobe.yaml
+++ b/.github/workflows/tiobe.yaml
@@ -18,8 +18,7 @@ jobs:
run: pip install tox~=4.2 coverage[toml] flake8 pylint websocket-client==1.* pyyaml==6.* pytest~=7.2 pytest-operat... |
canonical__operator-1373 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "ops/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/charm.py:SecretE... | canonical/operator | 94bf413d3593badfb3f9aa29cb2fdbbfff418d0f | Cannot call Secret.set_info and Secret.set_content in the same hook
If `Secret.set_info()` and `Secret.set_content()` are both called in the same hook, then whichever is first is ignored.
I expect that from a Juju point of view, this is because `secret_set` has been called twice and so it assumes that the later call... | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d4ed43f..1649f28 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v4.5.0
hooks:
- id: check-added-large-files
... |
canonical__operator-1458 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:Container.push_path"
],
"edited_modules": [
"ops/model.py:Container"
]
},
"file": "ops/model.py"
}
] | canonical/operator | 3fb8548682605046c7e8b9c9153b93c491141b30 | `Container.push_path()` only supports text files
As you can see in the linked code below, the `Container.push_path()` function only works with text files. Internally, it's calling `Container.push()`, but it doesn't allow customizing its parameters, so you can't specify *encoding*, *permissions*, *user_id* and so on.
... | diff --git a/ops/model.py b/ops/model.py
index a87001e..a86c2db 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -2662,7 +2662,7 @@ class Container:
if info.type is pebble.FileType.DIRECTORY:
self.make_dir(dstpath, make_parents=True)
continue
- ... |
canonical__operator-1562 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "docs/custom_conf.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/framework.py... | canonical/operator | 427aaf3339099c3ad584d9f7683926dfa2549e3c | Unhandled exception during refresh rollback of a charm
Example CI runs of the failure:
* https://github.com/canonical/pgbouncer-operator/actions/runs/13104359003/job/36577546859?pr=478
* https://github.com/canonical/postgresql-k8s-operator/actions/runs/13105001856/job/36577625971?pr=835
The error seems to happen when ... | diff --git a/docs/custom_conf.py b/docs/custom_conf.py
index e13bcad..e5bc315 100644
--- a/docs/custom_conf.py
+++ b/docs/custom_conf.py
@@ -295,7 +295,11 @@ autodoc_default_options = {
# This config value contains the locations and names of other projects
# that should be linked to in this documentation.
-intersph... |
canonical__operator-1598 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/charm.py:CharmMeta.__init__"
],
"edited_modules": [
"ops/charm.py:CharmMeta"
]
},
"file": "ops/charm.py"
}
] | canonical/operator | 2806558108a97105e7fc200462c58c0aadf81084 | Add charm-user to CharmMeta
charmcraft 3.2 adds support for a charm-user field in charmcraft.yaml. We load/expose all the other charmcraft fields, so should presumably load this one too. | diff --git a/.github/workflows/publish-ops-scenario.yaml b/.github/workflows/publish-ops-scenario.yaml
index 1efe190..9ed2dd0 100644
--- a/.github/workflows/publish-ops-scenario.yaml
+++ b/.github/workflows/publish-ops-scenario.yaml
@@ -29,7 +29,7 @@ jobs:
run: python -m build
working-directory: ./tes... |
canonical__operator-195 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/framework.py:Framework.save_snapshot"
],
"edited_modules": [
"ops/framework.py:Framework"
]
},
"file": "ops/framework.py"
}
] | canonical/operator | 02fe304edae9bce56f13cef32a2c48bdd150eb00 | save_shapshot validation failures unhelpful
The following validation code is in save_snapshot() in framework.py:
```python
# Use marshal as a validator, enforcing the use of simple types.
marshal.dumps(data)
```
Unfortunately, when validation fails the charm developer is left with nothing but the useless trace... | diff --git a/ops/framework.py b/ops/framework.py
index c8df98b..edfe802 100755
--- a/ops/framework.py
+++ b/ops/framework.py
@@ -558,8 +558,18 @@ class Framework(Object):
raise RuntimeError(
'cannot save {} values before registering that type'.format(type(value).__name__))
data = ... |
canonical__operator-199 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/framework.py:StoredState.__get__"
],
"edited_modules": [
"ops/framework.py:StoredState"
]
},
"file": "ops/framework.py"
}
] | canonical/operator | d259e0919fc19075b1e3636a5dd3c94ab81fd416 | Testing harness: cannot find StoredVariable attribute in type <CharmClass>
When the testing harness is used, having a state attribute on a charm [currently](https://github.com/canonical/operator/commit/44dff930667aa8e9b179c11fa87ceb8c9b85ec5a) raises an exception.
This happens because `Harness.begin` creates a new t... | diff --git a/ops/framework.py b/ops/framework.py
index abdd1fe..c8df98b 100755
--- a/ops/framework.py
+++ b/ops/framework.py
@@ -812,39 +812,78 @@ class BoundStoredState:
class StoredState:
+ """A class used to store data the charm needs persisted across invocations.
+
+ Example::
+
+ class MyClass(Ob... |
canonical__operator-360 | [
{
"changes": {
"added_entities": [
"ops/lib/__init__.py:_join_and",
"ops/lib/__init__.py:_Missing.__init__",
"ops/lib/__init__.py:_Missing.__str__",
"ops/lib/__init__.py:_Lib.__str__"
],
"added_modules": [
"ops/lib/__init__.py:_join_and",
"ops/li... | canonical/operator | ce327b21251af6e892270c34f33f6245e6425b3c | ops.lib.autoload does not log what it is doing
There are no diagnostics available for ops.lib.use failures beyond it raising an ImportError. Charm authors need to be able to discover *why* they got an ImportError. For example:
- the code they have included is for a different API version
- fails to import with an Im... | diff --git a/ops/lib/__init__.py b/ops/lib/__init__.py
index b69ce0a..88e9c5b 100644
--- a/ops/lib/__init__.py
+++ b/ops/lib/__init__.py
@@ -12,16 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys
+import logging
import os
import re
+impor... |
canonical__operator-475 | [
{
"changes": {
"added_entities": [
"ops/model.py:_ModelBackend._is_relation_not_found",
"ops/model.py:_ModelBackend.relation_remote_app_name"
],
"added_modules": null,
"edited_entities": [
"ops/model.py:Relation.__init__",
"ops/model.py:_ModelBackend.relat... | canonical/operator | 38a82715626e124404402c6cf9dd7e3bea147652 | Remote app is not added to RelationMapping for relations in some cases
- Two apps, one primary, one subordinate;
- Both have two units;
- A leader subordinate writes app relation data to a container-scoped relation for all primaries to read;
- The first primary observes the leader subordinate (relation-joined) which... | diff --git a/ops/model.py b/ops/model.py
index 9efec7d..d03a387 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -652,18 +652,28 @@ class Relation:
self.app = None
self.units = set()
- # For peer relations, both the remote and the local app are the same.
if is_peer:
+ # For... |
canonical__operator-492 | [
{
"changes": {
"added_entities": [
"ops/pebble.py:Service._dicts_to_tuples"
],
"added_modules": null,
"edited_entities": [
"ops/pebble.py:Service.__init__",
"ops/pebble.py:Service.to_dict"
],
"edited_modules": [
"ops/pebble.py:Service"
]
... | canonical/operator | 3d5170ee2c490bf96642d9f011424ff9a4eb187c | Can't send environment to pebble
I'm working on converting a charm to use pebble (as a proof of concept) and am running into problems trying to send it an `environment` configuration.
The pebble docs specify:
```
environment:
- VAR1: val1
- VAR2: val2
- VAR3: val3
... | diff --git a/ops/pebble.py b/ops/pebble.py
index b95c969..2f78aa3 100644
--- a/ops/pebble.py
+++ b/ops/pebble.py
@@ -447,7 +447,12 @@ class Layer:
class Service:
- """Represents a service description in a Pebble configuration layer."""
+ """Represents a service description in a Pebble configuration layer.
+
... |
canonical__operator-507 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:Network.__init__"
],
"edited_modules": [
"ops/model.py:Network"
]
},
"file": "ops/model.py"
}
] | canonical/operator | 67e7eedf7a16e6fb35834b68ab8e2cc04242eae9 | get_binding method raises a TypeError if called too early in charm lifecycle
## Bug
If the `self.model.get_binding()` is called too early in a charms lifecycle it raises a `TypeError`. This error is unexpected and is not documented in the `ops.model` docstrings. It would be OK return an empty result or even raise a kn... | diff --git a/ops/model.py b/ops/model.py
index 9f9a41f..ef49f71 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -559,8 +559,10 @@ class Network:
# interfaces with the same name.
for interface_info in network_info.get('bind-addresses', []):
interface_name = interface_info.get('interface-na... |
canonical__operator-513 | [
{
"changes": {
"added_entities": [
"ops/model.py:Container.pull",
"ops/model.py:Container.push"
],
"added_modules": null,
"edited_entities": [
"ops/model.py:Container.read_content",
"ops/model.py:Container.write_content"
],
"edited_modules": [
... | canonical/operator | 74d99960abe38b0c87499b2492d622a050d7cbe0 | Tune recently added file API function naming and calling convention
The outcome on this thread in PR #505 doesn't seem ideal:
https://github.com/canonical/operator/pull/505#discussion_r615019063
Let's please fix the API so it conforms with the spec naming (pull/push) and so that it uses a proper file-like interfa... | diff --git a/ops/model.py b/ops/model.py
index 6be1b93..d4e9b08 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -1091,31 +1091,35 @@ class Container:
raise RuntimeError('expected 1 service, got {}'.format(len(services)))
return services[service_name]
- def read_content(self, path: str, *, enc... |
canonical__operator-515 | [
{
"changes": {
"added_entities": [
"ops/pebble.py:Plan.to_dict"
],
"added_modules": null,
"edited_entities": [
"ops/pebble.py:Plan.to_yaml",
"ops/pebble.py:Layer.to_dict"
],
"edited_modules": [
"ops/pebble.py:Plan",
"ops/pebble.py:Layer... | canonical/operator | d43857090cca349ef39a7f2dbbe942d64ecc6311 | `get_pebble` not implemented in _TestingModelBackend so unit tests for pebble charms not possible
I'm working on converting a charm to use the new pebble approach as a proof of concept, but it seems all tests are failing with the following:
```
self = <test_charm.TestGunicornK8sCharm testMethod=test_validate_yaml>
... | diff --git a/ops/pebble.py b/ops/pebble.py
index e498b3c..a34d901 100644
--- a/ops/pebble.py
+++ b/ops/pebble.py
@@ -426,9 +426,18 @@ class Plan:
"""
return self._services
+ def to_dict(self) -> typing.Dict[str, typing.Any]:
+ """Convert this plan to its dict representation."""
+ as... |
canonical__operator-556 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"ops/model.py:Container.start",
"ops/model.py:Container.stop"
],
"edited_modules": [
"ops/model.py:Container"
]
},
"file": "ops/model.py"
}
] | canonical/operator | 184776476063a8234647e4787b252b729340da57 | Container.start() silently accepts no arguments and does nothing
`Container.start()` takes a variable number of strings as arguments, each specifying a service to be started. The issue is that it also accepts zero arguments without complain, even though it clearly indicates a mistake on the user.
I believe it should... | diff --git a/ops/model.py b/ops/model.py
index b58d729..d10c3f0 100644
--- a/ops/model.py
+++ b/ops/model.py
@@ -1043,10 +1043,14 @@ class Container:
def start(self, *service_names: str):
"""Start given service(s) by name."""
+ if not service_names:
+ raise TypeError('start expected at... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.