Skip to content

Add profile completion check in tools#72

Open
enrubio wants to merge 4 commits intomasterfrom
feat/add-profile-completion-check
Open

Add profile completion check in tools#72
enrubio wants to merge 4 commits intomasterfrom
feat/add-profile-completion-check

Conversation

@enrubio
Copy link
Copy Markdown
Member

@enrubio enrubio commented May 6, 2025

This PR adds a tools function to check a profile against a venue's minimum profile requirements. This is used in the Invite Assignment preprocess.

Changes need to match the openreview-py PR, so before merging this we should make sure there's not more feedback on that PR that needs to be moved here.

Example of what minRequirements can look like:

{ 
  history: true, 
  relations: false, 
  expertise: true, 
  publications: true, 
  active: true 
}

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new utility function to verify if a user's profile meets required venue criteria, enabling a consolidated check within tools.js.

  • Introduces the isProfileComplete method to validate profile properties against defined requirements.
  • Implements logic to traverse nested profile fields and conditionally validate based on expected value types.

Comment thread packages/client/src/tools.js Outdated
Comment thread packages/client/src/tools.js Outdated
Comment thread packages/client/src/tools.js Outdated
isProfileComplete(profile, profileReqs) {
// If no profile or no requirements, skip check
if (!profile.id.startsWith('~') || !profileReqs) {
return true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't you throw an error if a profile object is not passed?

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.

Decided to not check profile.id because the other tools functions that handle profiles don't do this and I think it should be handled at the call site.

Comment thread packages/client/src/tools.js Outdated
* @param {object} profileReqs - An object defining the required profile fields and conditions.
* @returns {boolean} - Returns true if the profile satisfies all requirements, false otherwise.
*/
isProfileComplete(profile, profileReqs) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a test to see what profileReqs looks like?

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.

It's located here right?: packages/client/test/test.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, that's the right spot.

Comment thread packages/client/src/tools.js Outdated
} else if (expectedValue === true && !actualValue) {
return false;
} else {
console.log(`Invalid path: ${profilePath}`);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we throw an error here instead of logging it?

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.

The logic was simplified so that PCs aren't allowed to require random parts of the profile. Now I ignore incorrect input from PCs by returning true (e.g. if they set "dblp": true) so that a person isn't wrongly marked as incomplete.

@melisabok
Copy link
Copy Markdown
Member

@enrubio there are some conflicts here.

@enrubio
Copy link
Copy Markdown
Member Author

enrubio commented Mar 10, 2026

The validation was simplified so that PCs should only require: history, relations, expertise, publications, and active state. Previously they could require any part of the profile, but that includes links which we should not allow.

Changes should be equivalent to what's in openreview-py.

The min requirements is defined in the domain content and there is no validation for PCs since they can directly modify the group. So this function explicitly checks for fields we will allow. A profile won't be marked as incomplete if PCs try to require DBLP, for example.

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.

4 participants