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
Bug 1910753: Use context directory to find devfile #7655
Bug 1910753: Use context directory to find devfile #7655
Conversation
/kind bug |
@rottencandy: This pull request references Bugzilla bug 1910753, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
3f9bbc0
to
94bff7a
Compare
@rottencandy: This pull request references Bugzilla bug 1910753, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
94bff7a
to
ae05210
Compare
@rottencandy: This pull request references Bugzilla bug 1910753, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -105,7 +112,7 @@ export class GithubService extends BaseService { | |||
const resp = await this.client.repos.getContents({ | |||
owner: this.metadata.owner, | |||
repo: this.metadata.repoName, | |||
path: 'Dockerfile', | |||
path: `${this.metadata.contextDir}/Dockerfile`, |
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 sure this works in almost all cases you tested. But because contextDir is defined as optional, I would like to request to check if contextDir is defined. So that we don't get an unexpected undefined/Dockerfile
in some edge-cases. Similar you have done in gitlab-service.ts
.
To archive this its maybe a good idea to create two helper functions isFilePresent(filename: string)
and getFileContent(filename: string)
which can do all these repeated work in this file where isDevfilePresent
ends as a redirect to just
isDevfilePresent = () => isFilePresent('devfile.yaml')
getDevfileContent = () => getFileContent('devfile.yaml')
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.
The getRepoMetadata
function will make sure that contextDir
will always be available, at least as an empty string, so IMO checking for that isn't needed. What do you think?
There are even test cases where contextDir
isn't provided.
Updated with helper functions isFilePresent
& getFileContent
.
ae05210
to
ef9ca72
Compare
@rottencandy: This pull request references Bugzilla bug 1910753, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
ef9ca72
to
095c07b
Compare
cc: @rohitkrai03 |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rohitkrai03, rottencandy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@rottencandy: All pull requests linked via external trackers have merged: Bugzilla bug 1910753 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes:
https://issues.redhat.com/browse/ODC-5297
Analysis / Root cause:
When using the UI to select a directory path for the git, it fails to take this into account when we go searching for the Devfile.
Solution Description:
Use context directory and determine the correct path of the devfile.
NOTE: Depends on #7470, only consider ef9ca72
Screen shots / Gifs for design review:
Browser conformance: