Merged
Conversation
Nadegamra
requested changes
Apr 9, 2025
Collaborator
There was a problem hiding this comment.
Here are the problems I see with the current context set command implementation:
- It is possible to set unrelated
itwin-idandimodel-idvalues. This could cause failure in commands, that use both flags. - You are able to have only
imodel-idset without having theitwin-idset. This would cause some commands to fail, when both flags are used and this situation could be avoided entirely by fetching the imodel and getting theitwin-idfrom there.
Contributor
Author
@Nadegamra Included the auto fetch for |
Nadegamra
reviewed
Apr 10, 2025
Collaborator
|
Currently there are no integration tests for the iTwin/IModel context functionality |
Contributor
Author
Added integration tests |
Nadegamra
previously approved these changes
Apr 10, 2025
Nadegamra
requested changes
Apr 11, 2025
Nadegamra
previously approved these changes
Apr 11, 2025
…51/context-implementation
Nadegamra
approved these changes
Apr 14, 2025
linasburneika
pushed a commit
that referenced
this pull request
Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this change, there will be 3 new commands:
1.
itp context infoWith this command, users can check their current context information. Ex:
2.
itp context setWith this command, users will be able to set
iTwinIdor/andiModelIdfor the context to be used across the CLI3.
itp context clearWith this command, users can clear existing context so that the values would not be referenced in the upcoming command execution.
Notes:
Once the context has been set, the user can execute commands like:
itp itwin info --jsonand get information about the itwin that is stored in the contextPriority:
From highest to lowest: