Skip to content

feat: add config on source#503

Open
guillermau wants to merge 2 commits intomainfrom
config-on-source
Open

feat: add config on source#503
guillermau wants to merge 2 commits intomainfrom
config-on-source

Conversation

@guillermau
Copy link
Collaborator

No description provided.

@guillermau guillermau self-assigned this Mar 17, 2026
const octokit = new Octokit({
auth: githubPersonalAccessTokenForApiRateLimit
});
export const repoGitHubEndpointMaker = (params?: { source?: Source }) => {
Copy link
Collaborator

@JeromeBu JeromeBu Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

petit détails c'est le nommage "repo" qui est en conflic avec les Repository chez nous, à voir si on trouve mieux... mais ça s'appelle bien repository aussi sur github...

(et la remarque de type ci dessous est aussi dans la suggestion ci dessous)

Suggested change
export const repoGitHubEndpointMaker = (params?: { source?: Source }) => {
type GithubSource = Extract<Source, { kind: 'github' }>
export const githubRepositoryEndpointMaker = (params: { source: GithubSource }) => {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

et niveau type, tu prendr nimporte quel type de source, je pense qu'on peut restrindre :

source: Extract<Source, { kind: 'github' }>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(aussi un raison pour que le param soit optionnel ? )

const octokit = new Octokit({
auth: githubPersonalAccessTokenForApiRateLimit
});
export const repoGitHubEndpointMaker = (params?: { source?: Source }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

et niveau type, tu prendr nimporte quel type de source, je pense qu'on peut restrindre :

source: Extract<Source, { kind: 'github' }>

const octokit = new Octokit({
auth: githubPersonalAccessTokenForApiRateLimit
});
export const repoGitHubEndpointMaker = (params?: { source?: Source }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(aussi un raison pour que le param soit optionnel ? )


return Object.fromEntries(
Object.entries(groupedData).map(([wikidataId, { license }]) => [wikidataId, license.split("/").reverse()[0]])
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai pas vu de tests nouveau pour valider les nouveaux comportement wikidata. Les existants étaient suffisant ? 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants