Skip to content

Conversation

@dthampy
Copy link
Contributor

@dthampy dthampy commented Apr 10, 2025

Description

The fix is to specifically look for packages that starts with @adobe/aio-cli-plugin so that only plugin packages that are explicitly tagged as AIO CLI plugins show up for the user and thus eliminating other packages like @adobe/aio-lib-ims-oauth, @adobe/aio-lib-ims-jwt etc

Related Issue

Motivation and Context

The issue was that aio discover command was returning an empty table because the npm registry API response structure changed- the package objects no longer contains a scope property that our code expects and hence the filtering returned an empty array.
Just adding a snippet of the first result for the package object from the response returned by the npm registry API follows this structure

"package": {
  "name": "@adobe/aio-cli-plugin-certificate",
  "keywords": ["oclif-plugin", "aio-cli-plugin", "ecosystem:aio-cli-plugin"],
  "version": "2.0.1",
  "description": "Generate and validate private certificates, and public key pairs for use with Adobe IO Console",
  "sanitized_name": "@adobe/aio-cli-plugin-certificate",
  "publisher": {
         "email": "grp-opensourceoffice@adobe.com",
          "username": "adobe-admin"
    },
  "maintainers": [ ... ],
  "license": "Apache-2.0",
  "date": "2024-02-08T14:59:17.603Z",
  "links": { ... }
}

How Has This Been Tested?

By linking the bugfix branch and running aio discover and aio discover -i
Verifiied the commands are returning expected results
Fixed the unit tests to match the new implementation

Screenshots (if appropriate):

aio discover
Screenshot 2025-04-09 at 8 18 48 PM

aio discover -i
Screenshot 2025-04-09 at 8 20 10 PM

aio discover --help

Screenshot 2025-04-10 at 9 28 33 AM

Types of changes

  • Bug fix (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 change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (74389d0) to head (9695de4).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #741   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          238       238           
  Branches        47        48    +1     
=========================================
  Hits           238       238           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@shazron shazron left a comment

Choose a reason for hiding this comment

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

LGTM. I would also add to the command's .description, this new filter that it will only list plugins that have that prefix

Copy link
Member

@purplecabbage purplecabbage left a comment

Choose a reason for hiding this comment

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

looks great!

@purplecabbage
Copy link
Member

LGTM. I would also add to the command's .description, this new filter that it will only list plugins that have that prefix

This was the way it used to work, adobe has just been moved from scope to name prefix.

@shazron
Copy link
Member

shazron commented Apr 10, 2025

LGTM. I would also add to the command's .description, this new filter that it will only list plugins that have that prefix

This was the way it used to work, adobe has just been moved from scope to name prefix.

I read the code yes - not sure what you mean, now it is "strict" (requires the plugin to have a certain prefix, not just scope) when before it was loose (scope only). The command description should reflect this new restriction

@dthampy
Copy link
Contributor Author

dthampy commented Apr 10, 2025

Updated the command description to clarify the new restrictive filtering behavior

@dthampy dthampy merged commit c1e6911 into master Apr 10, 2025
8 checks passed
@dthampy dthampy deleted the bugfix/ACNA-3480 branch April 10, 2025 17:21
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.

6 participants