Skip to content

Commit

Permalink
Merge branch 'main' into per_tenant_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shaangill025 authored Oct 4, 2023
2 parents fa9ad93 + ed1987b commit e6c3fe8
Show file tree
Hide file tree
Showing 53 changed files with 2,370 additions and 1,000 deletions.
19 changes: 0 additions & 19 deletions NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -355,25 +355,6 @@ THE SOFTWARE.
-----------------------------------------------------------------
-----------------------------------------------------------------

=> msgpack

Copyright (C) 2008-2011 INADA Naoki <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-----------------------------------------------------------------
-----------------------------------------------------------------

=> requests

Copyright (C) 2019 Kenneith Reitz
Expand Down
19 changes: 19 additions & 0 deletions UpgradingACA-Py.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ is high (such as a "resave connections" upgrade to a deployment with many, many
connections), you may want to do a test upgrade offline first, to see if there
is likely to be a service disruption during the upgrade. Plan accordingly!

## Tagged upgrades
Upgrades are defined in the [Upgrade Definition YML file], in addition to specifying upgrade actions by version they can also be specified by named tags. Unlike version based upgrades where all applicable version based actions will be performed based upon sorted order of versions, with named tags only actions corresponding to provided tags will be performed. Note: `--force-upgrade` is required when running name tags based upgrade [i.e. provding `--named-tag`]

Tags are specfied in YML file as below:
```
fix_issue_rev_reg:
fix_issue_rev_reg_records: true
```

Example
```
./scripts/run_docker upgrade --force-upgrade --named-tag fix_issue_rev_reg
In case, running multiple tags [say test1 & test2]:
./scripts/run_docker upgrade --force-upgrade --named-tag test1 --named-tag test2
```



## Exceptions

There are a couple of upgrade exception conditions to consider, as outlined
Expand Down
4 changes: 3 additions & 1 deletion aries_cloudagent/commands/default_version_upgrade_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ v0.7.1:
v0.7.0:
update_existing_records: false
v0.6.0:
update_existing_records: false
update_existing_records: false
fix_issue_rev_reg:
fix_issue_rev_reg_records: true
42 changes: 41 additions & 1 deletion aries_cloudagent/commands/tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,44 @@ async def test_upgrade_callable(self):
}
)

async def test_upgrade_callable_named_tag(self):
version_storage_record = await self.storage.find_record(
type_filter="acapy_version", tag_query={}
)
await self.storage.delete_record(version_storage_record)
with async_mock.patch.object(
test_module,
"wallet_config",
async_mock.CoroutineMock(
return_value=(
self.profile,
async_mock.CoroutineMock(did="public DID", verkey="verkey"),
)
),
), async_mock.patch.object(
test_module.yaml,
"safe_load",
async_mock.MagicMock(
return_value={
"v0.7.2": {
"resave_records": {
"base_record_path": [
"aries_cloudagent.connections.models.conn_record.ConnRecord"
]
},
"update_existing_records": True,
},
"fix_issue_rev_reg": {"fix_issue_rev_reg_records": True},
}
),
):
await test_module.upgrade(
settings={
"upgrade.named_tags": ["fix_issue_rev_reg"],
"upgrade.force_upgrade": True,
}
)

async def test_upgrade_x_same_version(self):
version_storage_record = await self.storage.find_record(
type_filter="acapy_version", tag_query={}
Expand Down Expand Up @@ -169,7 +207,9 @@ async def test_upgrade_missing_from_version(self):
"upgrade.config_path": "./aries_cloudagent/commands/default_version_upgrade_config.yml",
}
)
assert "No upgrade from version found in wallet or" in str(ctx.exception)
assert "Error during upgrade: No upgrade from version or tags found" in str(
ctx.exception
)

async def test_upgrade_x_callable_not_set(self):
version_storage_record = await self.storage.find_record(
Expand Down
Loading

0 comments on commit e6c3fe8

Please sign in to comment.