-
Notifications
You must be signed in to change notification settings - Fork 0
AS-3633-cb-cli-diff #71
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
base: master
Are you sure you want to change the base?
Conversation
… services and libraries and the system
…code service or library not found
createDiff.go
Outdated
} | ||
|
||
// had to use pullAllEdges instead of pullEdge inside the for loop because pullEdge lacked some information | ||
// like last_connect, last_disconnect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to diff on last_connect or last_disconnect so maybe we need to implement a blacklist of columns that we don't want to be considered in the diff. Would you mind sharing the full list of properties so that we can determine which ones belong in the blacklist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, below is the list of properties we have access to for the edges:
- broker_auth_port
- broker_port
- broker_tls_port
- broker_ws_auth_port
- broker_ws_port
- broker_wss_port
- description
- edge_key
- isConnected
- last_connect
- last_disconnect
- last_edge_type
- last_seen_architecture
- last_seen_os
- last_seen_version
- local_addr
- local_port
- name
- public_addr
- public_port
- token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, here's the full list of read-only fields:
broker_port
broker_tls_port
broker_ws_auth_port
broker_ws_port
broker_wss_port
edge_key
isConnected
last_connect
last_disconnect
last_edge_type
last_seen_architecture
last_seen_os
last_seen_version
local_addr
local_port
name
public_addr
public_port
token
The blacklist approach actually isn't ideal since we have to keep the cli in sync with the platform. Instead, let's only diff on the description field and any custom columns. Ethan recently made some changes to the cli to check for custom columns when determining whether a column should be added/removed. Can you reach out to him for a lead on how you can dynamically determine which columns are custom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll connect with Ethan about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
diff
commandThis command generates a
diff.json
file that contains the assets and entities that have been changed (or added) locally. This diff file can then be used to push only assets and entities to the system using thecb-cli push -diff=${path/to/diff.json}
command.