Skip to content
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

Disable editing for certain fields once bundle reaches starting state #4252

Merged
merged 23 commits into from
Sep 15, 2022

Conversation

leilenah
Copy link
Collaborator

Reasons for making this change

Currently, all bundle fields that aren't generated by CodaLab are editable by the user indefinitely. However, there are certain fields that don't make sense for the user to edit once a bundle has started running, e.g. store.

That being said, there are some fields that do make sense for the user to edit indefinitely such as name and description.

This change locks the following editable fields once a bundle has reached the starting state:

request_docker_image
request_time
request_memory
request_disk
request_cpus
request_gpus
request_queue
request_priority
request_network
exclude_patterns
store
allow_failed_dependencies

All other editable fields outside of the list above will remain editable indefinitely.

Related issues

#4203

Screenshots

Bundle Before starting State

image

Bundle After starting State

image

Checklist

  • I've added a screenshot of the changes, if this is a frontend change
  • I've added and/or updated tests, if this is a backend change
  • I've run the pre-commit.sh script
  • I've updated docs, if needed

@leilenah leilenah linked an issue Sep 12, 2022 that may be closed by this pull request
11 tasks
@leilenah
Copy link
Collaborator Author

@percyliang updated

@leilenah
Copy link
Collaborator Author

@percyliang value check updated

# Request a machine with this much resources and don't let run exceed these resources
# Don't format metadata specs
# fmt: off
METADATA_SPECS.append(MetadataSpec('request_docker_image', str, 'Which docker image (either tag or digest, e.g., codalab/default-cpu:latest) '
Copy link
Collaborator

Choose a reason for hiding this comment

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

I personally think that the original formatting is easier to read and see all the fields at one glance...what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I generally agree, but things like this hurts my heart:

Screen Shot 2022-09-14 at 10 24 44 PM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One option I've been vaguely thinking about is storing the definitions somewhere else. But I don't want to do that in the scope of this PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think putting the definitions here is nice so that everything is in one place. I agree that long lines and weird wrapping is not-ideal either... I only have a weak preference for the single lines, so feel free to wrap if you feel strongly about it.

* @returns {string} joined list values
*/
export function renderList(list) {
if (!list?.length || !list[0]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why !list[0]? In general, I'd like to be a bit more strict about the differences between falsy values...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The tags field returns [''] when there aren't any tags. Didn't want to change that in case doing so would break a bunch of stuff, but can change if you think I should.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I see...maybe write that down as a comment - this is something we should fix. No tags should be []!

@leilenah leilenah merged commit f744bf7 into master Sep 15, 2022
@leilenah leilenah deleted the feature/4203-disable-editing branch September 15, 2022 16:31
@epicfaace epicfaace mentioned this pull request Oct 3, 2022
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.

Disable editing for certain fields once bundle reaches starting state
2 participants