-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
feat: support context file location in repository #567
feat: support context file location in repository #567
Conversation
e2f1bc2
to
0dcf5ea
Compare
9f05f43
to
3e5e14d
Compare
639d864
to
ad39d0f
Compare
ad39d0f
to
93dd030
Compare
I tried manual testing Current CLI behaviour
PR behaviour - when I have no context
Expected behaviour - when I have no context
|
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'm missing some docs as well, but this is big task as we have no docs covering context, so I would say it is out of scope here. Please open a followup issue that we need to explain context concept, tips and tricks and also make sure we explain how to add context to a project, the file structure. Unless you think you can add something basic already
b29ede5
to
e160a2f
Compare
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.
nice you're adding docs, but from my side - it was not in scope. Normally docs should come with implementation but I'm also honest admitting there were zero docs for the concept, so this is other case. I'm totally fine to extend time for this issue and its scope, but please be prepared that it will take more time to merge (you probably notices it after my comments, and there will be also another review later from docs owner).
so in other words
- if you want to continue in this PR - I'm totally fine with it
- if you want to open a separate PR - I'm totally fine with it
After this moment the doc became intertwined with the code I wrote It is a yet another Bounty Program usecase. |
We extend the deadline to fit the appropriate time to complete the issue. These are some things we are learning through this Bounty Trial, and since it is necessary to add documentation, we have to extend the deadline. |
Integration of |
74f0199
to
95a0423
Compare
e110c3a
to
64d570d
Compare
856ddb6
to
7cbd02c
Compare
7cbd02c
to
4575a70
Compare
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.
amazing work mate!!! 🚀
code + tests + docs => full stack ❤️
@Souvikns @magicmatatjahu do you guys plan to review? It is a big feature, so I hope not 😆
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.
LGTM just left a small suggestion.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/rtm |
🎉 This PR is included in version 0.52.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR adds support of the context file's location in repository.
.asyncapi-cli
getContextFilePath()
searches for a context file named as specified inCONTEXT_FILENAME
:${os.homedir()}/.asyncapi-cli
and this path is assigned toCONTEXT_FILE_PATH
which is then returned on every request.getRepoRootPath()
searches for a supposed root of the repository starting from current directory all the way up the filesystem, using presence of the.git
directory as an indicator; if it doesn't find, then it is assumed that the root of the repository is the current directoryinitContext()
performs initialization of an empty context file with commandasyncapi config context init
in:asyncapi config context init .
(default)asyncapi config context init ./
asyncapi config context init ~
editContext()
performs edit of a specified context in context file's store (this functionality was previously handled byaddContext()
but possibility of edit was broken by introduction of the check if given context's name already exists in context file's store)isContextFileValid()
performs boolean validation of context file's format against interfaceIContextFile
isContextFileEmpty()
performs boolean check if context file can be considered a minimal empty context file, according to https://www.asyncapi.com/docs/tools/cli/context#minimalEmptyContextFileisContextFileValid()
) are ignored even if they have proper namecatch(error)
,catch(err)
andcatch(e)
were brought to unified formContextNotFound
was renamed toContextNotFoundError
, to keep error objects' naming in./src/errors/context-error.ts
in the same style./src/errors/context-error.ts
was tidied up overall./docs/context.md
with documentation on Context functionality was addedCurrent
@oclif/test
's implementation leads to unexpected results in some scenarios, all observations were described in./test/commands/context.test.ts
as comments. Making fixes to@oclif/test
is out of scope.Resolves #38