-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[server] infer extensions and add a comment #7392
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -36,16 +36,22 @@ export class ConfigurationService { | |||||||
} | ||||||||
// eagerly fetch for all files that the inferrer usually asks for. | ||||||||
this.requestedPaths.forEach(path => !(path in cache) && readFile(path)); | ||||||||
const config: WorkspaceConfig = await new ConfigInferrer().getConfig({ | ||||||||
const configInferrer = new ConfigInferrer(); | ||||||||
const config: WorkspaceConfig = await configInferrer.getConfig({ | ||||||||
config: {}, | ||||||||
read: readFile, | ||||||||
exists: async (path: string) => !!(await readFile(path)), | ||||||||
}); | ||||||||
if (!config.tasks) { | ||||||||
return; | ||||||||
} | ||||||||
const configString = `tasks:\n - ${config.tasks.map(task => Object.entries(task).map(([phase, command]) => `${phase}: ${command}`).join('\n ')).join('\n - ')}`; | ||||||||
return configString; | ||||||||
const configString = configInferrer.toYaml(config); | ||||||||
return `# This configuration file was automatically generated by Gitpod. | ||||||||
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) | ||||||||
jankeromnes marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
# and commit this file to your remote git repository to share the goodness with others. | ||||||||
Comment on lines
+49
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about the phrasing "to share the goodness with others", but I don't have a better proposal right now. @gtsiolis Would you have any suggestions to improve this comment? (It's added to every auto-generated Note: Let's not block this PR, but work on a better comment in a follow-up PR. |
||||||||
|
||||||||
${configString} | ||||||||
`; | ||||||||
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add a second empty line at the bottom of the file (can also be fixed in a follow-up):
Suggested change
|
||||||||
} | ||||||||
|
||||||||
async fetchRepositoryConfiguration(ctx: TraceContext, user: User, contextURL: string): Promise<string | undefined> { | ||||||||
|
@@ -54,7 +60,6 @@ export class ConfigurationService { | |||||||
return configString; | ||||||||
} | ||||||||
|
||||||||
|
||||||||
protected async getRepositoryFileProviderAndCommitContext(ctx: TraceContext, user: User, contextURLOrContext: string | CommitContext): Promise<{fileProvider: FileProvider, commitContext: CommitContext}> { | ||||||||
let commitContext: CommitContext; | ||||||||
if (typeof contextURLOrContext === 'string') { | ||||||||
|
Uh oh!
There was an error while loading. Please reload this page.