-
Notifications
You must be signed in to change notification settings - Fork 153
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(cli): discover additional app-config yamls #2484
Open
christoph-jerolimov
wants to merge
1
commit into
janus-idp:main
Choose a base branch
from
christoph-jerolimov:discover-additional-app-configs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,21 +293,16 @@ function discoverPluginConfigurationFile( | |
): string | undefined { | ||
// Possible file names, the first match will be used | ||
const supportedFilenames = [ | ||
'app-config.dynamic.example.yaml', | ||
'app-config.dynamic.yaml', | ||
'app-config.janus-idp.yaml', | ||
'app-config.backstage-community.yaml', | ||
'app-config.example.yaml', | ||
'app-config.yaml', | ||
]; | ||
return supportedFilenames | ||
.map<boolean>((fileName: string) => { | ||
const candidate = path.join(directory, fileName); | ||
return fs.existsSync(candidate); | ||
}) | ||
.reduce<string | undefined>((val, current, index) => { | ||
if (typeof val === 'undefined' && current) { | ||
return path.join(directory, supportedFilenames[index]); | ||
} | ||
return val; | ||
}, undefined); | ||
.map(fileName => path.join(directory, fileName)) | ||
.find(candidate => fs.existsSync(candidate)); | ||
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. 👍 to this change anyways 😄 |
||
} | ||
|
||
/** | ||
|
Oops, something went wrong.
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.
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 not sure about looking for
app-config.example.yaml
and even the existingapp-config.yaml
entry that was originally here. One thing I'd like to avoid is accidentally picking up one of these files that may contain a complete backstage configuration file for 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.
I can remove
app-config.yaml
, but please be aware that some plugins uses this currently.But since this feature is not documented (or?), I'm do what you prefer.
Should I remove it? :)
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.
Yep, we haven't documented this convention at all yet, so we can decide what we want to keep in the longer term. I'm not sure of the origin of even the
app-config.janus-idp.yaml
convention, either the intent was it's a file that is meant to be handled by thejanus-idp
CLI or maybe the intent was just to match it with the organization name, like what was done when plugins were moved to the community repo and thisapp-config.backstage-community.yaml
convention was introduced.That being said, the more I think about it, the more I think maybe it's better to just keep it simple and maybe we should eventually just narrow down this list to
app-config.yaml
despite my worry that an entire yaml config gets picked up by the tooling, it's much easier to remember :-)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.
or better still as @davidfestal suggested
app-config.dynamic.yaml
as the one we document and favor over the other fallbacks, I think that naming makes it pretty clear it's not like the other config files.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.
Maybe this log statement could be updated as part of this too to mention that.