Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This PR addresses issues found in https://github.com/valory-xyz/open-autonomy/pull/1701 #518

Merged
merged 16 commits into from
Jan 4, 2023

Conversation

angrybayblade
Copy link

@angrybayblade angrybayblade commented Jan 3, 2023

Proposed changes

This PR

  • Fixes path fix bug on the IPFS plugin
  • Agent package import issue on the test command
  • Bumps protocols to latest
  • Updates the not before and not after dates for libp2p certificates
  • Fixes the package manager v1 test after bumping the protocols
  • Bumps open-aea and aea-cli-ipfs plugin to post releases

Types of changes

What types of changes does your code introduce to agents-aea?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Lint and unit tests pass locally with my changes and CI passes too
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that code coverage does not decrease.
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Comment on lines +440 to +446
else:
perform_load_aea_package(
dir_=package_dir,
author=package_dir.parent.parent.name,
package_type_plural=PackageType(package_type).to_plural(),
package_name=package_dir.name,
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addresses https://github.com/valory-xyz/open-autonomy/actions/runs/3819359169/jobs/6496927078#step:7:9939 failure. We load agent packages in same manner as we load the component packages before running the tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the test for this branch? Why was it not required before?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did not load the agent package before because there was no code part of the agent component similar to other components so we could run the test without loading the agent package.

When I was recreating this issue locally I found out that this issue only occurs in one specific condition that is if you run the tests in a tox env and all packages available. When I ran tests for agents only by modifying the test command they ran without any issue and when I ran the same command we run in the tox env normally they ran without any issues as well.

So my assumption is since we're loading the components other than the agents the references in the sys.modules does not contain references to the packages.author.components and not the packages.author.agents which is the reason why the pytest was throwing import error.

Now this did not happen before, this started happening after the release of 1.27.0 and we haven't changed anything in the test command except for the #504 which does not look like could've caused the issue so this is still a mystery for me why this started happening suddenly

Comment on lines -339 to -340
error_msg = f"Expected a single directory, found: {paths}"
raise DownloadError(error_msg)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The downloaded object can be either a file or a directory, which can be wrapped under a wrapper node. So this gives 4 possibilities for a downloaded object. A file, file wrapped, dir and dir wrapped. We need a better mechanism to detect these 4 and filter out aea component packages. #519

Comment on lines +337 to +340
if len(paths) == 1:
(package_path,) = paths
else:
package_path = download_tmp_path
Copy link
Author

@angrybayblade angrybayblade Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continuing from #518 (comment), this will fix the issue but we need to make this method more robust in terms of working with different types of download objects

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angrybayblade @Karrenbelt
i think it's better to get rid of package terms in ipfs download tool.
the main purpose is to download:

  • a single file
  • a directory

and doesnt matter what is actually inside.

wrapped single file is a directory actually. with one file inside and it's filename
a directory downloaded by hash stored (default ipfs cli behaviour) as <target dir><hash>/<dir content> sometimes we want to have <target dir>/<dir contet> without dir with name <hash>

quite simple logic. content related operations should be done on the upper level.

my conclusion:

make ipfstool as simple as possible (download dir, file, retries)
content related things should be implemented somewhere else.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please open an issue for this so when we're working #519 we work on this afterwards

solarw
solarw previously approved these changes Jan 3, 2023
Copy link
Collaborator

@solarw solarw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -23,7 +23,7 @@
__title__ = "open-aea"
__description__ = "Open Autonomous Economic Agent framework (without vendor lock-in)"
__url__ = "https://github.com/valory-xyz/open-aea.git"
__version__ = "1.27.0"
__version__ = "1.27.0.post1"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post release bump

Comment on lines +25 to +26
LIBP2P_CERT_NOT_BEFORE = "2023-01-01"
LIBP2P_CERT_NOT_AFTER = "2024-01-01"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Date range update for the certificates

Comment on lines -160 to +167
update_aea_version_range(package_configuration=package_config)
assert not package_config.aea_version_specifiers.contains(
str(get_current_aea_version())
)

assert str(get_current_aea_version()) in package_config.aea_version
update_aea_version_range(package_configuration=package_config)
assert package_config.aea_version_specifiers.contains(
str(get_current_aea_version())
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of performing a strict check we perform a range check here. This check is failing because the current version of open-aea is 1.27.0.post1 and update_aea_version_range creates the version range as >=1.27.0, <2.0.0. We were checking if the exact version version (1.27.0.post1) was in the version range string or not and that's why the test failed. Now we're performing a check in the range.

Issue for the same #523

@codecov-commenter
Copy link

Codecov Report

Base: 92.90% // Head: 92.89% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (b77ab2d) compared to base (8ecfd83).
Patch coverage: 90.90% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #518      +/-   ##
==========================================
- Coverage   92.90%   92.89%   -0.01%     
==========================================
  Files         353      353              
  Lines       28799    28801       +2     
==========================================
  Hits        26756    26756              
- Misses       2043     2045       +2     
Flag Coverage Δ
unittests 92.89% <90.90%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aea/configurations/constants.py 100.00% <ø> (ø)
packages/fetchai/protocols/default/__init__.py 0.00% <ø> (ø)
packages/fetchai/protocols/default/dialogues.py 100.00% <ø> (ø)
packages/fetchai/protocols/default/message.py 53.33% <ø> (ø)
...ackages/fetchai/protocols/default/serialization.py 81.69% <ø> (ø)
packages/fetchai/protocols/fipa/__init__.py 0.00% <ø> (ø)
packages/fetchai/protocols/fipa/dialogues.py 100.00% <ø> (ø)
packages/fetchai/protocols/fipa/message.py 57.52% <ø> (ø)
packages/fetchai/protocols/fipa/serialization.py 87.61% <ø> (ø)
packages/fetchai/protocols/gym/__init__.py 0.00% <ø> (ø)
... and 40 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@solarw solarw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@angrybayblade angrybayblade merged commit d6c6c4d into main Jan 4, 2023
@DavidMinarsch DavidMinarsch deleted the fix/release-bugs branch January 4, 2023 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants