TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.51k stars 1.07k forks source link

[TT-11032] Godoc CI lint action, config and apidef/oas #6386

Closed titpetric closed 1 month ago

titpetric commented 1 month ago

User description

We generate outputs based on godocs from two different packages:

Two lint commands have been added into the taskfile, and apidef-oas:lint is enforced:

task apidef-oas:lint    # reports 66 violations, out of those 56 undocumented fields
task config:lint            # reports 411 violations, out of those 74 undocumented fields

As we provide user facing documentation, it should conform to our documentation standards. This PR should serve as the template for correcting godocs over these areas, as the CI change ensures we don't regress over time.

This aims to fix the apidef/oas state with missing documentation.


PR Type

Enhancement, Tests


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
Taskfile.yml
Update Taskfile to include config and OAS schema linting 

Taskfile.yml
  • Added new includes for config and apidef-oas taskfiles.
  • Updated lint task to include config:lint and apidef-oas:lint.
  • +8/-0     
    Taskfile.yml
    Add Taskfile for OAS schema tasks                                               

    apidef/oas/Taskfile.yml
  • Created new Taskfile for apidef/oas.
  • Added tasks for running tests, linting, and updating dependencies.
  • +33/-0   
    Taskfile.yml
    Add Taskfile for config tasks                                                       

    config/Taskfile.yml
  • Created new Taskfile for config.
  • Added tasks for running tests, linting, and updating dependencies.
  • +33/-0   

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    github-actions[bot] commented 1 month ago

    API Changes

    --- prev.txt    2024-07-08 17:06:02.066761874 +0000
    +++ current.txt 2024-07-08 17:05:59.022755550 +0000
    @@ -2596,10 +2596,12 @@
     TYPES
    
     type APIDef struct {
    -   OAS     *OAS
    +   // OAS contains the OAS API definition.
    +   OAS *OAS
    +   // Classic contains the Classic API definition.
        Classic *apidef.APIDefinition
     }
    -    APIDef is struct to hold both OAS and Classic forms of an API definition.
    +    APIDef holds both OAS and Classic forms of an API definition.
    
     type Allowance struct {
        // Enabled is a boolean flag, if set to `true`, then individual allowances (allow, block, ignore) will be enforced.
    @@ -2744,7 +2746,8 @@
     type Basic struct {
        // Enabled activates the basic authentication mode.
        // Tyk classic API definition: `use_basic_auth`
    -   Enabled     bool `bson:"enabled" json:"enabled"` // required
    +   Enabled bool `bson:"enabled" json:"enabled"` // required
    +   // AuthSources contains the source for HTTP Basic Auth credentials.
        AuthSources `bson:",inline" json:",inline"`
        // DisableCaching disables the caching of basic authentication key.
        // Tyk classic API definition: `basic_auth.disable_caching`
    @@ -3096,6 +3099,8 @@
         that were previously used to represent the same data.
    
     type EndpointPostPlugins []EndpointPostPlugin
    +    EndpointPostPlugins is a list of EndpointPostPlugins. It's used where
    +    multiple plugins can be run.
    
     func (e EndpointPostPlugins) ExtractTo(meta *apidef.GoPluginMeta)
         ExtractTo extracts *EndpointPostPlugin to *apidef.GoPluginMeta.
    @@ -3127,9 +3132,10 @@
        Kind Kind `json:"type" bson:"type"` // json tag is changed as per contract
        // ID is the ID of event handler in storage.
        ID string `json:"id,omitempty" bson:"id,omitempty"`
    -   // Name is the name of event handler
    +   // Name is the name of event handler.
        Name string `json:"name,omitempty" bson:"name,omitempty"`
    
    +   // Webhook contains WebhookEvent configs. Encoding and decoding is handled by the custom marshaller.
        Webhook WebhookEvent `bson:"-" json:"-"`
     }
         EventHandler holds information about individual event to be configured on
    @@ -3155,10 +3161,16 @@
         events are supported.
    
     type ExternalOAuth struct {
    -   Enabled     bool `bson:"enabled" json:"enabled"` // required
    +   // Enabled activates external oauth functionality.
    +   Enabled bool `bson:"enabled" json:"enabled"` // required
    +
    +   // AuthSources configures the source for the authentication token.
        AuthSources `bson:",inline" json:",inline"`
    -   Providers   []OAuthProvider `bson:"providers" json:"providers"` // required
    +
    +   // Providers is used to configure OAuth providers.
    +   Providers []OAuthProvider `bson:"providers" json:"providers"` // required
     }
    +    ExternalOAuth holds configuration for an external OAuth provider.
    
     type ExtractCredentialsFromBody struct {
        // Enabled activates extracting credentials from body.
    @@ -3197,7 +3209,7 @@
     type GatewayTags struct {
        // Enabled activates use of segment tags.
        Enabled bool `bson:"enabled" json:"enabled"`
    -   // Tags is a list of segment tags
    +   // Tags contains a list of segment tags.
        Tags []string `bson:"tags" json:"tags"`
     }
         GatewayTags holds a list of segment tags that should apply for a gateway.
    @@ -3228,7 +3240,7 @@
        // Deprecated: Use PostAuthenticationPlugins instead.
        PostAuthenticationPlugin *PostAuthenticationPlugin `bson:"postAuthenticationPlugin,omitempty" json:"postAuthenticationPlugin,omitempty"`
    
    -   // PostAuthenticationPlugin contains configuration related to the custom plugin that is run immediately after authentication.
    +   // PostAuthenticationPlugins contains configuration related to the custom plugin that is run immediately after authentication.
        // Tyk classic API definition: `custom_middleware.post_key_auth`.
        PostAuthenticationPlugins CustomPlugins `bson:"postAuthenticationPlugins,omitempty" json:"postAuthenticationPlugins,omitempty"`
    
    @@ -3240,7 +3252,7 @@
        // Tyk classic API definition: `custom_middleware.post`.
        PostPlugins CustomPlugins `bson:"postPlugins,omitempty" json:"postPlugins,omitempty"`
    
    -   // Deprecated: ResponsePlugin contains configuration related to the custom plugin that is run during processing of the response from the upstream service.
    +   // ResponsePlugin contains configuration related to the custom plugin that is run during processing of the response from the upstream service.
        // Deprecated: Use ResponsePlugins instead.
        ResponsePlugin *ResponsePlugin `bson:"responsePlugin,omitempty" json:"responsePlugin,omitempty"`
    
    @@ -3429,6 +3441,7 @@
        // Cache is the caching mechanism for introspection responses.
        Cache *IntrospectionCache `bson:"cache,omitempty" json:"cache,omitempty"`
     }
    +    Introspection holds configuration for OAuth token introspection.
    
     func (i *Introspection) ExtractTo(intros *apidef.Introspection)
    
    @@ -3441,25 +3454,73 @@
        // For introspection caching, it is suggested to use a short interval.
        Timeout int64 `bson:"timeout" json:"timeout"`
     }
    +    IntrospectionCache holds configuration for caching introspection requests.
    
     func (c *IntrospectionCache) ExtractTo(cache *apidef.IntrospectionCache)
    
     func (c *IntrospectionCache) Fill(cache apidef.IntrospectionCache)
    
     type JWT struct {
    -   Enabled                 bool `bson:"enabled" json:"enabled"` // required
    -   AuthSources             `bson:",inline" json:",inline"`
    -   Source                  string   `bson:"source,omitempty" json:"source,omitempty"`
    -   SigningMethod           string   `bson:"signingMethod,omitempty" json:"signingMethod,omitempty"`
    -   IdentityBaseField       string   `bson:"identityBaseField,omitempty" json:"identityBaseField,omitempty"`
    -   SkipKid                 bool     `bson:"skipKid,omitempty" json:"skipKid,omitempty"`
    -   PolicyFieldName         string   `bson:"policyFieldName,omitempty" json:"policyFieldName,omitempty"`
    -   ClientBaseField         string   `bson:"clientBaseField,omitempty" json:"clientBaseField,omitempty"`
    -   Scopes                  *Scopes  `bson:"scopes,omitempty" json:"scopes,omitempty"`
    -   DefaultPolicies         []string `bson:"defaultPolicies,omitempty" json:"defaultPolicies,omitempty"`
    -   IssuedAtValidationSkew  uint64   `bson:"issuedAtValidationSkew,omitempty" json:"issuedAtValidationSkew,omitempty"`
    -   NotBeforeValidationSkew uint64   `bson:"notBeforeValidationSkew,omitempty" json:"notBeforeValidationSkew,omitempty"`
    -   ExpiresAtValidationSkew uint64   `bson:"expiresAtValidationSkew,omitempty" json:"expiresAtValidationSkew,omitempty"`
    +   // Enabled activates the basic authentication mode.
    +   //
    +   // Tyk classic API definition: `enable_jwt`
    +   Enabled bool `bson:"enabled" json:"enabled"` // required
    +
    +   // AuthSources configures the source for the JWT.
    +   AuthSources `bson:",inline" json:",inline"`
    +
    +   // Source contains the source for the JWT.
    +   //
    +   // Tyk classic API definition: `jwt_source`
    +   Source string `bson:"source,omitempty" json:"source,omitempty"`
    +
    +   // SigningMethod contains the signing method to use for the JWT.
    +   //
    +   // Tyk classic API definition: `jwt_signing_method`
    +   SigningMethod string `bson:"signingMethod,omitempty" json:"signingMethod,omitempty"`
    +
    +   // IdentityBaseField specifies the claim name uniquely identifying the subject of the JWT.
    +   // The identity fields that are checked in order are: `kid`, IdentityBaseField, `sub`.
    +   //
    +   // Tyk classic API definition: `jwt_identity_base_field`
    +   IdentityBaseField string `bson:"identityBaseField,omitempty" json:"identityBaseField,omitempty"`
    +
    +   // SkipKid controls skipping using the `kid` claim from a JWT (default behaviour).
    +   // When this is true, the field configured in IdentityBaseField is checked first.
    +   //
    +   // Tyk classic API definition: `jwt_skip_kid`
    +   SkipKid bool `bson:"skipKid,omitempty" json:"skipKid,omitempty"`
    +
    +   // PolicyFieldName is a configurable claim name from which a policy ID is extracted.
    +   // The policy is applied to the session as a base policy.
    +   //
    +   // Tyk classic API definition: `jwt_policy_field_name`
    +   PolicyFieldName string `bson:"policyFieldName,omitempty" json:"policyFieldName,omitempty"`
    +
    +   // ClientBaseField is used when PolicyFieldName is not provided. It will get
    +   // a session key and use the policies from that. The field ensures that requests
    +   // use the same session.
    +   //
    +   // Tyk classic API definition: `jwt_client_base_field`
    +   ClientBaseField string `bson:"clientBaseField,omitempty" json:"clientBaseField,omitempty"`
    +
    +   // Scopes holds the scope to policy mappings for a claim name.
    +   Scopes *Scopes `bson:"scopes,omitempty" json:"scopes,omitempty"`
    +
    +   // DefaultPolicies is a list of policy IDs that apply to the session.
    +   //
    +   // Tyk classic API definition: `jwt_default_policies`
    +   DefaultPolicies []string `bson:"defaultPolicies,omitempty" json:"defaultPolicies,omitempty"`
    +
    +   // IssuedAtValidationSkew contains the duration in seconds for which token issuance can predate the current time during the request.
    +   IssuedAtValidationSkew uint64 `bson:"issuedAtValidationSkew,omitempty" json:"issuedAtValidationSkew,omitempty"`
    +
    +   // NotBeforeValidationSkew contains the duration in seconds for which token validity can predate the current time during the request.
    +   NotBeforeValidationSkew uint64 `bson:"notBeforeValidationSkew,omitempty" json:"notBeforeValidationSkew,omitempty"`
    +
    +   // ExpiresAtValidationSkew contains the duration in seconds for which the token can be expired before we consider it expired.
    +   ExpiresAtValidationSkew uint64 `bson:"expiresAtValidationSkew,omitempty" json:"expiresAtValidationSkew,omitempty"`
    +
        // IDPClientIDMappingDisabled prevents Tyk from automatically detecting the use of certain IDPs based on standard claims
        // that they include in the JWT: `client_id`, `cid`, `clientId`. Setting this flag to `true` disables the mapping and avoids
        // accidentally misidentifying the use of one of these IDPs if one of their standard values is configured in your JWT.
    @@ -3471,7 +3532,7 @@
         Import populates *JWT based on arguments.
    
     type JWTValidation struct {
    -   // Enabled activates OAuth access token validation by introspection to a third party.
    +   // Enabled activates OAuth access token validation.
        Enabled bool `bson:"enabled" json:"enabled"`
    
        // SigningMethod to verify signing method used in jwt - allowed values HMAC/RSA/ECDSA.
    @@ -3496,6 +3557,8 @@
        // ExpiresAtValidationSkew is the clock skew to be considered while validating the exp claim.
        ExpiresAtValidationSkew uint64 `bson:"expiresAtValidationSkew,omitempty" json:"expiresAtValidationSkew,omitempty"`
     }
    +    JWTValidation holds configuration for validating access tokens by inspecing
    +    them against a third party API, usually one provided by the IDP.
    
     func (j *JWTValidation) ExtractTo(jwt *apidef.JWTValidation)
    
    @@ -3638,12 +3701,23 @@
         UpdateServers sets or updates the first servers URL if it matches oldAPIURL.
    
     type OAuth struct {
    -   Enabled               bool `bson:"enabled" json:"enabled"` // required
    -   AuthSources           `bson:",inline" json:",inline"`
    +   // Enabled activates the OAuth middleware.
    +   Enabled bool `bson:"enabled" json:"enabled"` // required
    +
    +   // AuthSources configures the sources for OAuth credentials.
    +   AuthSources `bson:",inline" json:",inline"`
    +
    +   // AllowedAuthorizeTypes is an array of OAuth authorization types.
        AllowedAuthorizeTypes []osin.AuthorizeRequestType `bson:"allowedAuthorizeTypes,omitempty" json:"allowedAuthorizeTypes,omitempty"`
    -   RefreshToken          bool                        `bson:"refreshToken,omitempty" json:"refreshToken,omitempty"`
    -   AuthLoginRedirect     string                      `bson:"authLoginRedirect,omitempty" json:"authLoginRedirect,omitempty"`
    -   Notifications         *Notifications              `bson:"notifications,omitempty" json:"notifications,omitempty"`
    +
    +   // RefreshToken enables clients using a refresh token to get a new bearer access token.
    +   RefreshToken bool `bson:"refreshToken,omitempty" json:"refreshToken,omitempty"`
    +
    +   // AuthLoginRedirect configures a URL to redirect to after a successful login.
    +   AuthLoginRedirect string `bson:"authLoginRedirect,omitempty" json:"authLoginRedirect,omitempty"`
    +
    +   // Notifications configures a URL trigger on key changes.
    +   Notifications *Notifications `bson:"notifications,omitempty" json:"notifications,omitempty"`
     }
         OAuth configures the OAuth middleware.
    
    @@ -3651,9 +3725,13 @@
         Import populates *OAuth from it's arguments.
    
     type OAuthProvider struct {
    -   JWT           *JWTValidation `bson:"jwt,omitempty" json:"jwt,omitempty"`
    +   // JWT configures JWT validation.
    +   JWT *JWTValidation `bson:"jwt,omitempty" json:"jwt,omitempty"`
    +   // Introspection configures token introspection.
        Introspection *Introspection `bson:"introspection,omitempty" json:"introspection,omitempty"`
     }
    +    OAuthProvider holds the configuration for validation and introspection of
    +    OAuth tokens.
    
     type OIDC struct {
        // Enabled activates the OIDC authentication mode.
    @@ -3688,6 +3766,7 @@
     type OldOAS struct {
        openapifork.T
     }
    +    OldOAS serves for data model migration/conversion purposes (gorm).
    
     func (o *OldOAS) ConvertToNewerOAS() (*OAS, error)
         ConvertToNewerOAS converts a deprecated OldOAS object to the newer OAS
    @@ -3766,14 +3845,23 @@
         Operations holds Operation definitions.
    
     type Path struct {
    -   Delete  *Plugins `bson:"DELETE,omitempty" json:"DELETE,omitempty"`
    -   Get     *Plugins `bson:"GET,omitempty" json:"GET,omitempty"`
    -   Head    *Plugins `bson:"HEAD,omitempty" json:"HEAD,omitempty"`
    +   // Delete holds plugin configuration for DELETE requests.
    +   Delete *Plugins `bson:"DELETE,omitempty" json:"DELETE,omitempty"`
    +   // Get holds plugin configuration for GET requests.
    +   Get *Plugins `bson:"GET,omitempty" json:"GET,omitempty"`
    +   // Head holds plugin configuration for HEAD requests.
    +   Head *Plugins `bson:"HEAD,omitempty" json:"HEAD,omitempty"`
    +   // Options holds plugin configuration for OPTIONS requests.
        Options *Plugins `bson:"OPTIONS,omitempty" json:"OPTIONS,omitempty"`
    -   Patch   *Plugins `bson:"PATCH,omitempty" json:"PATCH,omitempty"`
    -   Post    *Plugins `bson:"POST,omitempty" json:"POST,omitempty"`
    -   Put     *Plugins `bson:"PUT,omitempty" json:"PUT,omitempty"`
    -   Trace   *Plugins `bson:"TRACE,omitempty" json:"TRACE,omitempty"`
    +   // Patch holds plugin configuration for PATCH requests.
    +   Patch *Plugins `bson:"PATCH,omitempty" json:"PATCH,omitempty"`
    +   // Post holds plugin configuration for POST requests.
    +   Post *Plugins `bson:"POST,omitempty" json:"POST,omitempty"`
    +   // Put holds plugin configuration for PUT requests.
    +   Put *Plugins `bson:"PUT,omitempty" json:"PUT,omitempty"`
    +   // Trace holds plugin configuration for TRACE requests.
    +   Trace *Plugins `bson:"TRACE,omitempty" json:"TRACE,omitempty"`
    +   // Connect holds plugin configuration for CONNECT requests.
        Connect *Plugins `bson:"CONNECT,omitempty" json:"CONNECT,omitempty"`
     }
         Path holds plugin configurations for HTTP method verbs.
    @@ -3875,7 +3963,7 @@
        // Block request by allowance.
        Block *Allowance `bson:"block,omitempty" json:"block,omitempty"`
    
    -   // Ignore authentication on request by allowance.
    +   // IgnoreAuthentication ignores authentication on request by allowance.
        IgnoreAuthentication *Allowance `bson:"ignoreAuthentication,omitempty" json:"ignoreAuthentication,omitempty"`
    
        // TransformRequestMethod allows you to transform the method of a request.
    @@ -4095,7 +4183,7 @@
        // Tyk classic API definition: `detailed_tracing`
        DetailedTracing *DetailedTracing `bson:"detailedTracing,omitempty" json:"detailedTracing,omitempty"`
    
    -   // Events contains the configuration related to Tyk Events.
    +   // EventHandlers contains the configuration related to Tyk Events.
        //
        // Tyk classic API definition: `event_handlers`
        EventHandlers EventHandlers `bson:"eventHandlers,omitempty" json:"eventHandlers,omitempty"`
    @@ -4238,14 +4326,32 @@
         ServiceDiscoveryCache holds configuration for caching ServiceDiscovery data.
    
     type Signature struct {
    -   Enabled          bool       `bson:"enabled" json:"enabled"` // required
    -   Algorithm        string     `bson:"algorithm,omitempty" json:"algorithm,omitempty"`
    -   Header           string     `bson:"header,omitempty" json:"header,omitempty"`
    -   Query            AuthSource `bson:"query,omitempty" json:"query,omitempty"`
    -   Secret           string     `bson:"secret,omitempty" json:"secret,omitempty"`
    -   AllowedClockSkew int64      `bson:"allowedClockSkew,omitempty" json:"allowedClockSkew,omitempty"`
    -   ErrorCode        int        `bson:"errorCode,omitempty" json:"errorCode,omitempty"`
    -   ErrorMessage     string     `bson:"errorMessage,omitempty" json:"errorMessage,omitempty"`
    +   // Enabled activates signature validation.
    +   // Tyk classic API definition: `auth_configs[X].validate_signature`.
    +   Enabled bool `bson:"enabled" json:"enabled"` // required
    +   // Algorithm is the signature method to use.
    +   // Tyk classic API definition: `auth_configs[X].signature.algorithm`.
    +   Algorithm string `bson:"algorithm,omitempty" json:"algorithm,omitempty"`
    +   // Header is the name of the header to consume.
    +   // Tyk classic API definition: `auth_configs[X].signature.header`.
    +   Header string `bson:"header,omitempty" json:"header,omitempty"`
    +   // Query is the name of the query parameter to consume.
    +   // Tyk classic API definition: `auth_configs[X].signature.use_param/param_name`.
    +   Query AuthSource `bson:"query,omitempty" json:"query,omitempty"`
    +   // Secret is the signing secret used for signature validation.
    +   // Tyk classic API definition: `auth_configs[X].signature.secret`.
    +   Secret string `bson:"secret,omitempty" json:"secret,omitempty"`
    +   // AllowedClockSkew configures a grace period in seconds during which an expired token is still valid.
    +   // Tyk classic API definition: `auth_configs[X].signature.allowed_clock_skew`.
    +   AllowedClockSkew int64 `bson:"allowedClockSkew,omitempty" json:"allowedClockSkew,omitempty"`
    +   // ErrorCode configures the HTTP response code for a validation failure.
    +   // If unconfigured, a HTTP 401 Unauthorized status code will be emitted.
    +   // Tyk classic API definition: `auth_configs[X].signature.error_code`.
    +   ErrorCode int `bson:"errorCode,omitempty" json:"errorCode,omitempty"`
    +   // ErrorMessage configures the error message that is emitted on validation failure.
    +   // A default error message is emitted if unset.
    +   // Tyk classic API definition: `auth_configs[X].signature.error_message`.
    +   ErrorMessage string `bson:"errorMessage,omitempty" json:"errorMessage,omitempty"`
     }
         Signature holds the configuration for signature validation.
    
    @@ -4389,14 +4495,23 @@
         Fill fills *TransformRequestMethod from apidef.MethodTransformMeta.
    
     type TykExtensionConfigParams struct {
    -   UpstreamURL     string
    -   ListenPath      string
    -   CustomDomain    string
    -   ApiID           string
    -   Authentication  *bool
    -   AllowList       *bool
    +   // UpstreamURL configures the upstream URL.
    +   UpstreamURL string
    +   // ListenPath configures the listen path.
    +   ListenPath string
    +   // CustomDomain configures the domain name.
    +   CustomDomain string
    +   // ApiID is the API ID.
    +   ApiID string
    +
    +   // Authentication is true if the API configures authentication.
    +   Authentication *bool
    +   // AllowList is true if the API configures an allow list.
    +   AllowList *bool
    +   // ValidateRequest is true if the API enables request validation.
        ValidateRequest *bool
    -   MockResponse    *bool
    +   // MockResponse is true if a mocked response is configured.
    +   MockResponse *bool
     }
         TykExtensionConfigParams holds the essential configuration required for the
         Tyk Extension schema.
    @@ -4435,8 +4550,8 @@
     type URLRewriteCondition string
         URLRewriteCondition defines the matching mode for an URL rewrite rules.
    
    -    - Value `any` means any of the defined trigger rules may match - Value `all`
    -    means all the defined trigger rules must match
    +    - Value `any` means any of the defined trigger rules may match. - Value
    +    `all` means all the defined trigger rules must match.
    
     type URLRewriteInput string
         URLRewriteInput defines the input for an URL rewrite rule.
    @@ -4450,6 +4565,8 @@
         match pattern against request body - `requestContext`, match pattern against
         request context
    
    +    The default `url` is used as the input source.
    +
     func (i URLRewriteInput) Err() error
         Err returns an error if the type value is invalid, nil otherwise.
    
    @@ -4461,17 +4578,6 @@
    
     type URLRewriteRule struct {
        // In specifies one of the valid inputs for URL rewriting.
    -   // By default, it uses `url` as the input source.
    -   //
    -   // The following values are valid:
    -   //
    -   // - `url`, match pattern against URL
    -   // - `query`, match pattern against named query parameter value
    -   // - `path`, match pattern against named path parameter value
    -   // - `header`, match pattern against named header value
    -   // - `sessionMetadata`, match pattern against session metadata
    -   // - `requestBody`, match pattern against request body
    -   // - `requestContext`, match pattern against request context
        In URLRewriteInput `bson:"in" json:"in"`
    
        // Name is the index in the value declared inside `in`.
    @@ -4494,10 +4600,7 @@
         URLRewriteRule represents a rewrite matching rules.
    
     type URLRewriteTrigger struct {
    -   // Condition indicates the logical combination that will be applied to the rules for an advanced trigger:
    -   //
    -   // - Value `any` means any of the defined trigger rules may match
    -   // - Value `all` means all the defined trigger rules must match
    +   // Condition indicates the logical combination that will be applied to the rules for an advanced trigger.
        Condition URLRewriteCondition `bson:"condition" json:"condition"`
    
        // Rules contain individual checks that are combined according to the
    github-actions[bot] commented 1 month ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 3 ๐Ÿ”ต๐Ÿ”ต๐Ÿ”ตโšชโšช
    ๐Ÿงช PR contains tests
    ๐Ÿ”’ No security concerns identified
    โšก Key issues to review

    **Possible Bug:** Ensure that the dependencies for the new tasks (`config:lint` and `apidef-oas:lint`) are correctly integrated and do not conflict with existing tasks. **Documentation:** Verify that the new tasks and their descriptions are clearly documented and understandable for future maintenance.
    github-actions[bot] commented 1 month ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Add error handling for linting commands to enhance robustness ___ **Consider adding error handling for the commands in the 'lint' task to manage potential
    failures during the linting process. This can help in identifying issues early and
    maintaining the robustness of the build process.** [apidef/oas/Taskfile.yml [26-28]](https://github.com/TykTechnologies/tyk/pull/6386/files#diff-077a7173655cb910898c8cb17ad0be73ecb04086fa2644afa609dfa5eb0a2b4fR26-R28) ```diff lint: desc: "Ensure linter pass" cmds: - - schema-gen extract -o - | schema-gen lint -i - + - schema-gen extract -o - | schema-gen lint -i - || echo "Linting failed" && exit 1 ```
    Suggestion importance[1-10]: 8 Why: Adding error handling for linting commands is a best practice that can help identify issues early and maintain the robustness of the build process.
    8
    Enhancement
    Add validation steps to check the existence of directories before task execution ___ **Introduce consistency checks or validation steps in the task configurations to ensure that
    all necessary files and directories are present before tasks are executed. This can
    prevent issues during task execution due to missing resources.** [Taskfile.yml [17-22]](https://github.com/TykTechnologies/tyk/pull/6386/files#diff-cd2d359855d0301ce190f1ec3b4c572ea690c83747f6df61c9340720e3d2425eR17-R22) ```diff config: taskfile: config/Taskfile.yml dir: config/ + validate: + - if: '[ ! -d config/ ]' + sh: echo "Directory config/ not found"; exit 1 apidef-oas: taskfile: apidef/oas/Taskfile.yml dir: apidef/oas/ + validate: + - if: '[ ! -d apidef/oas/ ]' + sh: echo "Directory apidef/oas/ not found"; exit 1 ```
    Suggestion importance[1-10]: 7 Why: Adding validation steps can prevent runtime errors due to missing directories, enhancing the robustness of the task execution process.
    7
    Maintainability
    Group related tasks under a common namespace to improve maintainability ___ **To improve the maintainability and readability of the task configurations, consider
    grouping related tasks under a common namespace or prefix. This can help in organizing
    tasks better and making the taskfile easier to navigate.** [Taskfile.yml [82-83]](https://github.com/TykTechnologies/tyk/pull/6386/files#diff-cd2d359855d0301ce190f1ec3b4c572ea690c83747f6df61c9340720e3d2425eR82-R83) ```diff -- lint:config -- lint:x-tyk-gateway -- coprocess:lint -- config:lint -- apidef-oas:lint +- lint: + - config + - x-tyk-gateway + - coprocess + - config + - apidef-oas ```
    Suggestion importance[1-10]: 3 Why: While grouping related tasks can improve readability, the current structure is already clear and the suggestion does not provide a significant improvement.
    3
    sonarcloud[bot] commented 1 month ago

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    0.0% Coverage on New Code
    0.0% Duplication on New Code

    See analysis details on SonarCloud

    titpetric commented 1 month ago

    /release to release-5.3

    tykbot[bot] commented 1 month ago

    Working on it! Note that it can take a few minutes.

    tykbot[bot] commented 1 month ago

    @titpetric Succesfully merged PR