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

Asset Bundle Importer #163

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

mukeshreddy44
Copy link

@mukeshreddy44 mukeshreddy44 commented Apr 24, 2024

Description

Type of change

Please select the type of change this is:

  • Bug fix
  • New feature
  • Documentation
  • Code refactor

Proposed Changes

Test cases and results

Checklist:

Please review the following items and mark as complete when done.

  • Evidence that the image has been tested on a local cluster.
  • Are there associated documentation updates required, if so please link JIRA item (or PR if it exists)?
  • Is this PR a change on the release branch ? If so, please link corresponding PR to develop
  • Is there at least 2 assigned reviewers ?
  • Are there any pipeline updates required ?
  • Test Evidence is available and covering all scenarios ?
  • JIRA work item acceptance criteria met and work item updated ?
  • Reviewers notified via Slack of the PR link (as JIRA emails get lost).
  • Does your branch contain the JIRA reference ?

Checklist for reviewers:

  • SLA on reviewers: 2 days wait time.
  • Reject being a reviewer if you don't have enough time, or not familiar with code
  • Code should be clear, understandable and commented

@mukeshreddy44 mukeshreddy44 marked this pull request as draft April 24, 2024 03:01
@mukeshreddy44 mukeshreddy44 marked this pull request as ready for review April 24, 2024 13:35
@LarsenEric
Copy link
Member

I wonder if this is an appropriate name for the connector.
From my understanding this connector is meant to allow users to upload their own data to the CAR service.
If that is correct I think it should have a name that better describes its purpose. To me, 'Sample Connector' implies that is is a sample or example that can be used to build further connectors from.
Let me know if this makes sense.

@LarsenEric
Copy link
Member

Is the data folder test data? If so, what uses it?
I see no tests included for this connector, we would expect that there be unit testing with new connectors.

@LarsenEric
Copy link
Member

Can you explain why you have an empty file: deployment/build.sh ?

@mukeshreddy44 mukeshreddy44 changed the title Sample connector Asset Bundle Importer Jun 11, 2024
@mukeshreddy44
Copy link
Author

Is the data folder test data? If so, what uses it? I see no tests included for this connector, we would expect that there be unit testing with new connectors.

The primary intention of this connector is to quickly load sample data into the connector. Although I see no tests in the reference connector, it would make sense to add some unit test cases. I’ll work on it!

@@ -0,0 +1,127 @@
# Asset(Sample) ISC-CAR

Asset(Sample) CAR Connector
Copy link
Member

Choose a reason for hiding this comment

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

Asset Bundle Importer

@mukeshreddy44
Copy link
Author

I wonder if this is an appropriate name for the connector. From my understanding this connector is meant to allow users to upload their own data to the CAR service. If that is correct I think it should have a name that better describes its purpose. To me, 'Sample Connector' implies that is is a sample or example that can be used to build further connectors from. Let me know if this makes sense.

Renamed it to asset

@mukeshreddy44
Copy link
Author

Is the data folder test data? If so, what uses it? I see no tests included for this connector, we would expect that there be unit testing with new connectors.

The primary intention of this connector is to quickly load sample data into the connector. Although I see no tests in the reference connector, it would make sense to add some unit test cases. I’ll work on it!

@LarsenEric Added test cases!


Running the connector:
```
python3 app.py -car-service-url=http://localhost:3000/api/car/v2 -car-service-key=none -car-service-password=none -source=test -host=https://raw.githubusercontent.com/mukeshreddy44/cp4s-car-connectors/dummy_connector/data
Copy link
Member

Choose a reason for hiding this comment

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

Can this be presented in a more general fashion? We shouldn't be referencing a personal github in the README.
For example, see how we do it for other connectors:
https://github.com/IBM/cp4s-car-connectors/blob/develop/connectors/crowdstrike/README.md?plain=1#L183
https://github.com/IBM/cp4s-car-connectors/blob/develop/connectors/nozomi/README.md?plain=1#L203

connectors/asset/app.py Outdated Show resolved Hide resolved
data/apps.json Outdated
@@ -0,0 +1,2102 @@
[
Copy link
Member

Choose a reason for hiding this comment

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

Is this the same data as connectors/asset/tests/mock_data ?

Copy link
Member

Choose a reason for hiding this comment

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

I am wondering why we need to add a data folder outside of the connector's folder structure

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it's the same data, but I've separated it because it will be accessed by clients, and I don't want it to be accidentally modified or interfered with. We can definitely place it inside the connector, but I thought it would be easier to access it from the root folder.

Copy link
Author

Choose a reason for hiding this comment

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

@LarsenEric Updated the data folder location.

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.

2 participants