Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Add a few more Actions (#38)
Browse files Browse the repository at this point in the history
* add markdown check

* migrate docs to new directory structure

* address documentation lint errors
  • Loading branch information
davidji99 authored Nov 4, 2020
1 parent 0cb34d8 commit ec07796
Show file tree
Hide file tree
Showing 17 changed files with 1,401 additions and 72 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 7 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['go']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
51 changes: 51 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Documentation Checks
on:
push:
branches:
- master
pull_request:
paths:
- .markdownlinkcheck.json
- .markdownlint.yml
- .github/workflows/documentation.yml
- docs/**

env:
GO_VERSION: "1.14"
GO111MODULE: on

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.markdownlinkcheck.json'
folder-path: 'docs'
file-extension: '.md'
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: avto-dev/markdown-lint@v1
with:
config: '.markdownlint.yml'
args: 'docs'
misspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd tools && go install github.com/client9/misspell/cmd/misspell
- run: misspell -error -source text docs/
23 changes: 23 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Configuration for markdownlint
# https://github.com/DavidAnson/markdownlint#configuration

default: true
MD007:
indent: 4

# Disabled Rules
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md

MD001: false
MD004: false
MD006: false
MD010: false
MD012: false
MD013: false
MD014: false
MD022: false
MD024: false
MD034: false
MD038: false
MD040: false
MD047: false
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion website/docs/index.html.markdown → docs/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "rollbar_project" "service-x" {
## Authentication

Certain resources in Rollbar require either the `account_access_token` or `project_access_token`. Based on observation,
the `account_access_token` is used more frequently for this provider's resources. You must supply both tokens
the `account_access_token` is used more frequently for this provider's resources. You must supply both tokens
if your terraform configuration code manages resources that require both access tokens. Otherwise, one access token
must be supplied to your provider block or sourced from other means.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ permissions in other to manage this resource. Refer to https://docs.rollbar.com/
For more information on the supported values when constructing a rule, please visit [this page](https://explorer.docs.rollbar.com/#tag/Notifications/paths/~1api~11~1notifications~1pagerduty~1rules/put).

~> NOTE: Due to API limitations, it is not possible to selectively `GET`, `DELETE` or `CREATE` a single notification rule.
Whatever rule(s) you define in your terraform configuration **will be the only rules** present in your account
after a `terraform apply`. This is especially important to understand if you have pre-existing rules in your account
prior to terraform managing this resource or rules created outside of terraform. In other words, this provider/terraform
Whatever rule(s) you define in your terraform configuration **will be the only rules** present in your account
after a `terraform apply`. This is especially important to understand if you have pre-existing rules in your account
prior to terraform managing this resource or rules created outside of terraform. In other words, this provider/terraform
will overwrite any remotely defined rules not in your configuration files. Furthermore, it is strongly advised that you only declare a single `rollbar_pagerduty_notification_rule` across all your terraform configuration files for the reasons above.

## Example Usage
Expand Down Expand Up @@ -63,7 +63,7 @@ The following arguments are supported:

* `filter` - (Required)

* `type` - (Required) `<string>` The type of rule filter.
* `type` - (Required) `<string>` The type of rule filter.
Valid options are: `environment`, `level`, `title`, `filename`,`context`, `method`, `framework`, `path`,
`rate`,`unique_occurrences`.

Expand All @@ -85,27 +85,28 @@ The following arguments are supported:

#### Rule Explanation
Certain rule triggers will require certain filters. Here are some of the following requirements:

1. Define a `filter.type` of `rate` when constructing an `occurrence_rate` rule trigger.

Please refer to the official [Rollbar OpenAPI specification](https://explorer.docs.rollbar.com/main.yaml) for more information.

#### Filter Options

As of Feb 11th, 2020, the Rollbar Rest API documentation does not present the available options to the `rule.filter`
attribute block in an easily readable manner. Therefore, this section will provide a summary of the available
As of Feb 11th, 2020, the Rollbar Rest API documentation does not present the available options to the `rule.filter`
attribute block in an easily readable manner. Therefore, this section will provide a summary of the available
options for `rule.filter`:

1. For `filter.type` of `environment`:
* Valid `filter.operation` option(s): `eq`, `neq`
* Valid `filter.value` option(s): any freeform `string`*

1. For `filter.type` of `level`:
* Valid `filter.operation` option(s): `eq`, `gte`
* Valid `filter.value` option(s): `debug`, `info`, `warning`, `error`, `critical` (case sensitive!)
* Valid `filter.operation` option(s): `eq`, `gte`
* Valid `filter.value` option(s): `debug`, `info`, `warning`, `error`, `critical` (case sensitive!)

1. For `filter.type` of `title`:
* Valid `filter.operation` option(s): `within`, `nwithin`, `regex`, `nregex`
* Valid `filter.value` option(s): any freeform `string`*
* Valid `filter.operation` option(s): `within`, `nwithin`, `regex`, `nregex`
* Valid `filter.value` option(s): any freeform `string`*

1. For `filter.type` of `filename`:
* Valid `filter.operation` option(s): `within`, `nwithin`, `regex`, `nregex`
Expand All @@ -121,7 +122,7 @@ options for `rule.filter`:

1. For `filter.type` of `framework`:
* Valid `filter.operation` option(s): `eq`
* Valid `filter.value` option(s): any freeform `string`*
* Valid `filter.value` option(s): any freeform `string`

1. For `filter.type` of `rate`:
* Valid `filter.period` option(s): Whole number greater than zero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The following attributes are exported:
Existing project(s) can be imported using the project id.

For example:

```
$ terraform import rollbar_project.follbar <PROJECT_ID>
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ If you need a higher rate limit, please contact support@rollbar.com.

**NOTE:** As of (August 6th, 2020), the Rollbar API does not provide support for the following
and therefore cannot be implemented in the provider:

1. Deleting access tokens. Instead, the provider will 'disable' the token by setting its rate limit to 1 call per 30 days
and remove the resource from your state. Then, the user can delete the token in the Rollbar UI.
1. Updating a project access token's `name`, `status`, and `scopes`. Users will need to make updates via the UI
Expand Down Expand Up @@ -59,10 +60,10 @@ Valid options: `read`, `write`, `post_server_item`, `post_client_server`.
* `status` - (Required) `<string>` Enable or disable the access token. Valid options: `enabled`, `disabled`.

* `rate_limit_window_size` `<integer>` - Period of time (in seconds) for the rate limit. On **resource creation only**,
the valid options are the following: `0, 60, 300, 1800, 3600, 86400, 604800, 2592000`.
the valid options are the following: `0, 60, 300, 1800, 3600, 86400, 604800, 2592000`.
Otherwise, any value greater than `0`. If this argument is not set, the default is 60 seconds (1 minute).

* `rate_limit_window_count` `<integer>` - Number of requests for the defined rate limiting period.
* `rate_limit_window_count` `<integer>` - Number of requests for the defined rate limiting period.
Otherwise, any value greater than `0`. If this argument is not set, the default is 5000 calls.

## Attributes Reference
Expand All @@ -81,6 +82,7 @@ and will not be shown in any non-debug `terraform` outputs.
Existing project access tokens(s) can be imported using a combination of the project id & access token separated by a colon.

For example:

```
$ terraform import rollbar_project_access_token.follbar <PROJECT_ID>:<ACCESS_TOKEN>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The following attributes are exported:
Existing team(s) can be imported using the team id.

For example:

```
$ terraform import rollbar_team.follbar <TEAM_ID>
```
11 changes: 11 additions & 0 deletions tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/davidji99/terraform-provider-rollbar/tools

go 1.15

require (
github.com/bflad/tfproviderdocs v0.7.0
github.com/client9/misspell v0.3.4
github.com/golangci/golangci-lint v1.31.0
github.com/katbyte/terrafmt v0.2.1-0.20200913185704-5ff4421407b4
github.com/terraform-linters/tflint v0.20.2
)
Loading

0 comments on commit ec07796

Please sign in to comment.