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
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2017-05-30 12:49:32 UTC
Target Upstream Version:
Embargoed:


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):
v1.5.0-alpha.1+68d4d0a-322-dirty

How reproducible:
Always

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

https://github.com/openshift/origin-web-console/commit/c18ec4c25a935709f1f49637495d25dc6efc2dd6
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.

https://bugzilla.redhat.com/show_bug.cgi?id=1415083

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.