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

DA-311: Deploy as a Function #4

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Conversation

teetangh
Copy link
Collaborator

@teetangh teetangh commented Jun 6, 2023

Description

Whenever someone right-clicks on a .JS file in their project, add an option called “Deploy as a Couchbase Function“.

It should open a new dialog where you show the name of the cluster that it is currently connected to, and ask for the user to pick the bucket (select/combo component), and then pick the scope (Select/Combo component). When the user clicks on “ok“, you should call the following endpoint:

curl -XPOST -d @./[sample_name].json 'http://anyAuthedUser:[email protected]:8096/api/v1/functions/[sample_name]?bucket=[fs_bucket]&scope=[fs_scope]'

Full documentation here: Eventing REST API | Couchbase Docs under “Table 2. Eventing Functions API (advanced)“.

Validations:

  • Scope and Bucket are required.
  • If the user hasn’t picked a bucket yet, the scope Select should be disabled.
  • if the user chooses another bucket, the list of scopes should be updated.
  • If the function already exists in the server, ask the user if he would like to overwrite the one existing in the server.
  • Don’t forget to test the functions that you deploy, to make sure that they are working.

@teetangh teetangh self-assigned this Jun 6, 2023
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from 0faa6a2 to 8df6047 Compare June 6, 2023 13:36
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from 8df6047 to c9e88a0 Compare June 6, 2023 13:38
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from 7aac1ac to 496f0fe Compare June 9, 2023 05:45
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from eb577e4 to 595258f Compare June 12, 2023 04:54
@teetangh
Copy link
Collaborator Author

This is the UI

First line - heading
Function Scope(Bold) bucket.scope(small greyed out) info icon(on hover displays-A bucket.scope combination used for identifying functions belonging to the same group.)

Error label for this(by default when nothing is selected)-> Please specify a scope to which the function belongs. User should have Eventing Manage Scope Functions permission on this scope

Second line - two horizontal dropdown boxes

  1. Select from available buckets (or *) 2. Select from scopes available in that bucket (The first scope gets selected automatically when the bucket is selected)

Third line - heading
Listen to location (Bold) bucket.scope.collection (small greyed out) info icon(on hover displays-The function will listen to this resource for changes. Memcached buckets are not allowed.)

Error label for this(by default when nothing is selected)-> Please specify a source location for your function. User should have DCP Data Read permission on this keyspace

Fourth line - three horizontal dropdown boxes

  1. Select from available buckets (or *) 2. Select from scopes available in that bucket (The first scope gets selected automatically when the bucket is selected) 3. Select from collections available in that scope (The first collection gets selected automatically when the scope is selected)

Fifth line - heading
Eventing Storage (Bold) bucket.scope.collection (small greyed out) info icon(on hover displays-This resource is used to store system data and should not be used by other applications.)

Error label for this(by default when nothing is selected)-> Please specify a location to store Eventing data. User should have read/write permission on this keyspace

Sixth line - three horizontal dropdown boxes

  1. Select from available buckets (or *) 2. Select from scopes available in that bucket (The first scope gets selected automatically when the bucket is selected) 3. Select from collections available in that scope (The first collection gets selected automatically when the scope is selected)

Seventh line - heading
Function Name (Bold)

Eighth line - full line text box
Text box for Function Name

Error label depends on text box validation

Ninth line - heading
Deployment Feed Boundary(Bold) info icon(on hover The preferred Deployment time Feed Boundary for the function.)

Tenth line - 1 drop down box with 2 options
The dropdown box should contain “Everything” and “From now”

Eleventh line - heading
Description(bold) optional(text in small, grayed out and round braces)

Twelfth line - Text Area
Text Area for big paragraph text writing (This is a text area not a text field)

Thirteenth line - Openable Settings.
Settings(bold)
There is a small right arrow before the word settings. On clicking the right menu. The form fill-up menu opens up
{
First line - heading
System Log Level(Bold) , small info icon(on hover shows: Granularity of system events being captured in the log)

Second line - dropdown menu
Dropdown menu contains: Info, Error, Warning, Debug and Trace

Info label - below dropdown menu
“Application log file for this Function is at:”

Third Line - heading
N1QL Consistency(bold) small info icon(on hover shows: Consistency level of N1QL statements in the function)

Fourth line - dropdown menu
Dropdown menu contains: None and Request

Fifth Line - heading
Workers(bold) small info icon(on hover shows: Number of workers per node to process the events. If no value is specified, a default value of 1 worker is used.)

Sixth Line - text field
Text field can take only a natural number

Seventh line - heading
Language compatibility (Bold) , small info icon(on hover shows: Language compatibility of the function)

Eighth line - dropdown menu
Dropdown menu contains: 6.0.0, 6.5.0, 6.6.2

Ninth Line - heading
Script Timeout(bold) in seconds (small greyed out text) small info icon(on hover shows: Time after which the Function's execution will be timed out)

Tenth Line - text field
Text field can take only a natural number (default initial value: 60)

Eleventh Line - heading
Timer Context Max Size (bold) small info icon(on hover shows: Maximum allowed value of the Timer Context Size in Bytes. Takes effect immediately.)

Twelfth Line - text field
Text field can take only a natural number (default initial value: 1024)
}

Fourteen Line - Openable Settings.
Binding Type (Bold left end of line) (Plus minus square buttons on the right end[plus adds a new binding type based on the dropdown menu, minus removes the last binding type])
Horizontal line separator.

Here we can add any number of 3 types of binding types[from the dropdown menu(s)]. The dropdown menu contains:
Binding type(default unelectable greyed out), Bucket Alias, URL alias, constant alias.

{

  1. if it is bucket alias, then first line is bucket alias(the dropdown menu itself), and textfield with placeholder text of “alias name”
    Second line contains heading Bucket(bold) bucket.scope.collection (small greyed out) Access(bold)
    Third line contains 3 dropdown boxes for bucket scope collection respectively. And 4th dropdown for Access(2 options of “read only” and “read and write” )

  2. If its URL alias, then first line is URL alias(the dropdown menu itself), and two textfields containing placeholder texts of “Alias name..” and “URL...” Respectively.
    The next line contains two checkboxes: 1. allow cookies 2. validate SSL certificate
    The next line contains dropdown menu of: 1. no auth 2. basic 3. bearer4. digest
    {
    2a. if the user chooses, basic, the same line as dropdown menu should have two textfields containing placeholder texts of “Username..” and “password…” Respectively.
    2b. if the user chooses, bearer, the same line as dropdown menu should have 1 textfield containing placeholder texts of “bearer key..”
    2c. if the user chooses, digest, the same line as dropdown menu should have two textfields containing placeholder texts of “Username..” and “password…” Respectively.
    }

    if it is constant alias, the first line is constant alias(the dropdown menu itself) and two textfields containing placeholder texts of “Username..” and “password…” Respectively.
    }

@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from fe70c41 to bf27a80 Compare June 14, 2023 07:07
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from c85ff57 to 1bd6744 Compare June 14, 2023 07:11
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from 36ef2b1 to e01bf00 Compare June 29, 2023 08:52
@teetangh teetangh force-pushed the DA-311-deploy-as-a-function branch from d4d0529 to 3999c3a Compare June 30, 2023 06:04
@teetangh teetangh marked this pull request as ready for review July 4, 2023 09:38
@teetangh teetangh requested a review from deniswsrosa July 4, 2023 09:38
@teetangh teetangh added the enhancement New feature or request label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants