timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-17011] More convenient job selection control #2942

Open timja opened 11 years ago

timja commented 11 years ago

For fields assignable to Item, the preferred UI control type is unclear. There are two choices in the field:

  1. text field, with completion
  2. drop down of all possibilities

#1 adds little overhead to the server even on large installations, and supports relative paths, but is forbidding for many users. #2 is easy to use, at least for smaller installations, but cannot render relative paths. We might like a hybrid.

https://wiki.jenkins-ci.org/display/JENKINS/Chosen+plugin is a possibility but might be too much for some browsers and it is not clear that it supports editable combos anyway.

Better might be an adaptive control which loads the item list asynch, then if the current value exists, show it; otherwise, or if an Edit button is clicked, switch to a text field view with completion. There can be a cutoff on the number of items displayed in the pulldown, e.g. 1000, before switching to the text field automatically.


Originally reported by jglick, imported from: More convenient job selection control
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 11 years ago

jglick:

Should also consider whether identifying items by relative path was a good idea to begin with. It is not always easy or even possible to evaluate a relative path when the value is needed. During form validation you can usually use hacks like @AncestorInPath to guess at the context, though not always; and there is no equivalent magic thread-local variable (that I know of) available during deserialization (Converter.unmarshal).

And what was the purpose? Depending on the UI control chosen, it is not necessarily more convenient for users. It is not necessary in order to order to maintain relationships between jobs in folders created from template, since you could simply ensure that the target folder path is a variable available during template expansion. It could be used to ensure that sets of related jobs behave the same way when moved or copied to another folder, but renaming jobs—and moving only dependent jobs to other folders—anyway requires that Jenkins use ItemListener.onLocationChanged to update item name references, whether they are relative or absolute.

timja commented 9 years ago

danielbeck:

I've relied on the current behavior in Copy Artifact plugin (using the simple/short name of a project in the same folder) a lot when creating (release) branch folders for a product: Just copy the previous release's folder and increment a few (Folders Plus) variables, and done.

While this could be considered a bug (not pointing to the original folder's job, e.g. ../previous_release/Project) it works quite well.

timja commented 9 years ago

jglick:

While this could be considered a bug

If a folder is copied which includes both an absolute-path-referring job and its referent, the reasonable expectation is that an onLocationChanged implementation ought to ensure that the reference points to the copied referent, not the original. Most likely some kind of helper utility in core is required to make this kind of logic practical.

timja commented 9 years ago

danielbeck:

absolute-path-referring job and its referent

To clarify, the reference to /release_folder/Up from /release_folder/Down is Up. So the current behavior of retaining Up rather than becoming e.g. ../release_folder/Up when creating a copy /new_release of /release_folder works quite well.

timja commented 9 years ago

jglick:

Right, I am just saying that if the original referent were instead /release_folder/Up then you would expect to copied reference to become /new_release/Up. CJP-1522 (visible only to CloudBees employees) is an example of this.

timja commented 8 years ago

danielbeck:

, I am just saying that if the original referent were instead /release_folder/Up then you would expect to copied reference to become /new_release/Up.

Actually, no, I would not. Absolute references are absolute.

What happens when you copy a folder with a bunch of symlinks in them? Absolute ones point to the original item, relative ones possibly point to a copied item.

timja commented 2 years ago

[Originally related to: JENKINS-21853]

timja commented 2 years ago

[Epic: JENKINS-31156]