Skip to content

Allow for HF org with different name from code platform org#110

Merged
egrace479 merged 15 commits into
devfrom
feat/mismatched-hf
Jun 16, 2026
Merged

Allow for HF org with different name from code platform org#110
egrace479 merged 15 commits into
devfrom
feat/mismatched-hf

Conversation

@egrace479

@egrace479 egrace479 commented Jun 11, 2026

Copy link
Copy Markdown
Member

As I was setting up a test config for a Codeberg organization, the challenge of a Hugging Face org having a different name than the code platform org became glaringly obvious. This PR fixes that by adding a HF_ORGANIZATION_NAME parameter. As discussed in #93, adding a different data or model platform would be a much bigger project requiring community motivated use-case(s), and having HF optional would be similar. Thus, this is a simple parameter addition; the app also requires it to be filled.

It also adds a config validation check on Vite start which includes a check that the organization name variables are follow platform format specifications. It is better, especially in a dev/setup context, to have the app fail with an informative message instead of appearing to work but with only online console errors. Example local console output with invalid HF org name and unsupported platform passed:

terminal error message with red x  [CONFIG ERROR] Vite failed to start due to the following configuration errors: \n 1. HF_ORGANIZATION_NAME (abc center) is invalid, only letters, numbers, hyphens, and underscores are allowed \n  2. PLATFORM must be one of: github \n Please fix the listed issue(s) in ./public/config.yaml and try again.

The config path is defined from a variable in the message.

@egrace479 egrace479 added enhancement New feature or request structure Refactoring or architecture, general code organization labels Jun 11, 2026
@egrace479 egrace479 requested a review from Copilot June 11, 2026 21:42

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread src/validateConfig.js Outdated
Comment thread package.json Outdated
Comment thread vite.config.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comment thread vite.config.js Outdated
Comment thread vite.config.js Outdated
Comment thread src/validateConfig.js
Comment thread src/validateConfig.js
@egrace479 egrace479 requested a review from beanbean9339 June 13, 2026 18:34
Comment thread public/config.yaml Outdated
ORGANIZATION_NAME: imageomics # GitHub/Hugging Face organization name (lowercase for API calls)
ORG_NAME: Imageomics # Display name for GitHub organization (can differ from API name)
ORGANIZATION_NAME: imageomics # Codebase platform organization name (lowercase for API calls)
HF_ORGANIZATION_NAME: imageomics # Hugging Face organization name (lowercase for API calls)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since HF_ORGANIZATION_NAME is now required, have we confirmed this won't break existing deployments using older config files that only define ORGANIZATION_NAME?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can build in backwards compatibility by using ORGANIZATION_NAME as a fallback, but I've also added validation for the config earlier and am fixing some of the other fallbacks, so I'm not sure we'd want to keep pulling that forward.

Comment thread vite.config.js
Comment thread src/validateConfig.js Outdated

@beanbean9339 beanbean9339 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think overall it looks good to go. Just a few things I noticed while reviewing, but none of them would block functionality, more so things to consider:

  • The lowercase validation is helpful, though it may be worth considering validation against allowed organization name characters in the future rather than only checking case.
  • CONFIG_PATHandparsedConfiginvite.config.jscould potentially beconstinstead oflet` since they don't appear to be reassigned.

Other than that, the implementation, tests, and documentation updates all look good to me

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread src/validateConfig.js Outdated
Comment thread src/validateConfig.js Outdated
Comment thread main.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Comment thread vite.config.js
Comment thread src/validateConfig.js
Comment thread public/config.yaml
Comment thread docs/personalization.md
Comment thread AGENTS.md
Comment thread tests/validateConfig.test.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread src/validateConfig.js Outdated
@egrace479 egrace479 requested a review from beanbean9339 June 16, 2026 00:54

@beanbean9339 beanbean9339 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall looks good to me. Nice work separating the HF org handling and tightening up validation and tests. Looks good to merge 👍

@egrace479 egrace479 merged commit ba4b755 into dev Jun 16, 2026
1 check passed
@egrace479 egrace479 deleted the feat/mismatched-hf branch June 16, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request structure Refactoring or architecture, general code organization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants