Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1415083 - Post-commit with Argument alone will reset Hook Types on web-console
Summary: Post-commit with Argument alone will reset Hook Types on web-console
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Samuel Padgett
QA Contact: Yadan Pei
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-20 08:04 UTC by XiaochuanWang
Modified: 2017-05-30 12:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-05-30 12:49:32 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description XiaochuanWang 2017-01-20 08:04:18 UTC
Description of problem:
Save "Hook Types" with "Shell Script with Arguments" or "Command with Arguments", only set argument and check the bc edit page again, "Hook Types" is set to "Arguments to default image entry point"

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. # oc new-project xiaocwan-t
# oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json
2. # Edit bc on web console
click "Show advanced options" and find "Post-Commit Hooks"
set "Hook Types" -> Shell Script with Arguments
    Script ->    <leave it empty>
    1 arguments: hello -> click Add
Hit Save
3. Go to the bc edit page and check "Hook Types" for "Post-Commit Hooks" 
4. set "Hook Types" -> Command with Arguments
    Script ->    <leave it empty>
    1 arguments: hello -> click Add 
5. Hit Save and go to the bc edit page again, check "Hook Types" for "Post-Commit Hooks" again

Actual results:
3&5 "Hook Types" is set to "Arguments to default image entry point"

Expected results:
3&5, Hook Types should be the value user saved.

Additional info:

Comment 1 Samuel Padgett 2017-01-20 13:26:41 UTC
This is working as intended, although confusing. It switched to "Arguments to default image entry point" because you did not provide a command (so "Command with arguments" is not possible).

I'm changing the editor to make the fields required based on the selected type to avoid the problem. It also keeps users from typing a command and forgetting to click the "Add" button.

Comment 2 openshift-github-bot 2017-01-20 13:51:25 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

Bug 1415083 - Make build hook fields required for selected type

Make the post-commit hook inputs required when the type is selected in
the build hook type dropdown. Hooks can be removed by unchecking the
"Run build hooks" checkbox.


Comment 3 XiaochuanWang 2017-01-22 03:35:05 UTC
Verified on openshift v3.5.0.7+390ef18

Save button is disabled when command/script is empty. "Hook Type" is remained when script has only one empty line.

Note You need to log in before you can comment on or make changes to this bug.