RBENREJEB@RBR-OS:/USR/SHARE/DOC/DATAFORM-INTELLIJ-PLUGIN/CONFIGURATION$ CAT README
DOCUMENTATION
Configuration
Google Cloud Dataform Plugin for IntelliJ · Documentation
Configuration happens in two places:
- Plugin settings: Node.js, the Dataform CLI and Core, and the editor options. They are needed to compile the project, so set them up first.
- Google Cloud: the project’s prerequisites, sign-in and Dataform repositories, needed by the features that call Google Cloud (BigQuery dry runs and schemas, workflow runs, query execution, workspaces).
Plugin settings
The plugin compiles your project with the Dataform CLI, which runs on Node.js. Node.js must be installed and configured in the IDE before the Dataform CLI and Core can be installed.
All Node.js settings are on Settings ▸ Languages & Frameworks ▸ JavaScript Runtime. From there you can let IntelliJ IDEA download Node.js for you, or point it to a Node.js you installed yourself.
Install Node.js from IntelliJ IDEA
This is the simplest way: IntelliJ IDEA downloads Node.js, with npm, and configures it in one step.
- Open Settings ▸ Languages & Frameworks ▸ JavaScript Runtime.
- Open the Node.js runtime list and choose Add ▸ Download….
- In the download dialog, pick a Version (prefer the latest LTS release) and the Location where Node.js will be installed, then click Download.
- When the download completes, the new runtime is selected, and the package manager is set to its
bundled
npm. - Click OK.
Use an existing Node.js installation
If Node.js is already installed on your computer, or you prefer to install it yourself:
- Windows: download the installer from nodejs.org and run it.
- Linux: install the
nodejsandnpmpackages of your distribution, for examplesudo apt install nodejs npmon Debian and Ubuntu orsudo dnf install nodejs npmon Fedora, or use a version manager such as nvm.
Check the installation in a terminal:
node --version
npm --version
Then configure it in the IDE:
- Open Settings ▸ Languages & Frameworks ▸ JavaScript Runtime.
- Select your installation in the Node.js runtime list; it lists the installations IntelliJ IDEA
detects. If it is missing, choose Add ▸ Add Local… and select its
nodeexecutable. - Check that the package manager points to the matching
npm. - Click OK.
When a Dataform project is opened while Node.js is not configured, the plugin shows an Npm not available notification; its Configure nodeJs link opens the JavaScript Runtime settings.
Install the Dataform CLI and Core
Once Node.js is configured, the plugin looks for @dataform/cli and @dataform/core in the global
node_modules of that installation. If they are missing, a Dataform not configured notification
appears; its Configure link opens the Dataform settings.
- Open Settings ▸ Tools ▸ Dataform. The page shows the Node.js installation the packages will be installed into, or a warning if Node.js is not configured yet.
- Click Install Dataform CLI & Core. The plugin runs
npm install -gfor@dataform/cli, then@dataform/core, into that Node.js installation. - When the installation succeeds, Dataform Core directory is filled in for you.
If you already installed the packages yourself (npm install -g @dataform/cli @dataform/core), the
plugin finds them and sets the Dataform Core directory automatically.
Dataform settings
The other options on Settings ▸ Tools ▸ Dataform:
| Setting | Description |
|---|---|
| Dataform Core directory | Where @dataform/core is installed, used to compile the project. |
| SQLFluff formatter ▸ Executable | Path to sqlfluff, to format SQLX files with SQLFluff. |
| SQLFluff formatter ▸ Config file | Optional .sqlfluff configuration file, passed as --config. |
| SQLFluff formatter ▸ Extra arguments | Added after the other arguments, separated by spaces. |
| Fold Dataform expressions to their evaluated value | Shows ${...} expressions as their value. Values are computed by running your project’s JavaScript with the configured Node.js interpreter, so you can turn this off. |
| Show Dataform compilation and BigQuery errors inline in the editor | Shows compilation and dry-run errors on the tokens they refer to. |
| BigQuery cost | Whether the compiled preview shows estimated costs, how bytes are priced (list price per location, a fixed price per TiB, or capacity pricing) and the currency. See BigQuery cost. |
The project is recompiled when you stop typing, when you save, and after external changes such as a checkout or a pull, so the compiled graph, previews and lineage stay up to date.
Google Cloud prerequisites
Features that call Google Cloud need a project with the Dataform API and the BigQuery API enabled.
The service account Dataform uses in that project needs these roles:
| Role | Role ID |
|---|---|
| BigQuery Data Editor | roles/bigquery.dataEditor |
| BigQuery Data Viewer | roles/bigquery.dataViewer |
| BigQuery Job User | roles/bigquery.jobUser |
| Dataform Service Agent | roles/dataform.serviceAgent |
| Service Account Token Creator | roles/iam.serviceAccountTokenCreator |
| Service Account User | roles/iam.serviceAccountUser |
Google Cloud sign-in
Highlighting, most completion, navigation and local compilation work without Google Cloud. Column completion and the column features use table schemas from BigQuery dry runs, so they need the sign-in.
Everything below is done from the Dataform Tools tool window, on the right side of the IDE. It is available in projects that contain a Dataform project.
- Open the Dataform Tools tool window.
- Click Sign in to Google Cloud in the tool window, or Sign In to Google Cloud in its options menu (⋮). Your browser opens the Google sign-in page.
- Choose your account and accept the requested access. The browser then shows a confirmation page and you can return to the IDE.
The credential is stored in the IDE password store and shared by all your projects and windows, so you sign in once. When a feature needs Google Cloud and you are not signed in, or your session has expired, a banner at the top of the editor asks you to sign in. While you are signed in, the options menu shows Sign Out of Google Cloud.
Your Google account is used only to call Google Cloud on your behalf. See Why the plugin asks you to sign in with Google and the Privacy Policy.
Configure a Dataform repository
A repository entry tells the plugin which Dataform repository in Google Cloud the local project belongs to. You can declare several, for example one per environment, and switch between them.
- Open the Dataform Tools tool window.
- Click Add repository… (shown while none is configured), or Manage Repositories… in the repository picker or the options menu (⋮).
-
In the Manage Dataform Repositories dialog, click + and fill the form:
VID.01 // The Location and Service Account fields filter their list as you type Field Description Label The name shown in the repository picker, for example devorprod.GCP Project ID The Google Cloud project that hosts the Dataform repository. Repository ID The name of the Dataform repository. Location The region of the repository, for example europe-west1. Type to filter the list.Service Account Optional. The service account workflow runs use. The list is filled with the service accounts of the project, then the other ones granted a role in it, such as the Google-provided Dataform service agent; type to filter it. - Click Test Connection to check that the repository is reachable with your account. The result is shown next to the button.
- If the repository does not exist yet, click Create in Google Cloud to create it in the project and location you entered.
- Click Save.
The dialog also lets you copy an entry (handy when only the project or location changes) and remove one. Label, project ID, repository ID and location are required.
Repository entries are stored per project, in .idea/dataform-gcp-repository-setting.xml. Your
credential is never written there.
Service account
When a service account is set, workflow invocations started from the IDE run with that identity,
the same way a release or workflow configuration in Google Cloud does. Create in Google Cloud also
sets it on the new repository. Your own account needs permission to act as that service account
(roles/iam.serviceAccountUser), and the service account needs the roles listed in
Google Cloud prerequisites. Leave the field empty to let Dataform use
the repository’s default identity.
Active repository and workspace
The repository chosen in the repository picker at the top of the tool window is the active one: compilation, dry runs, workflow runs and the Dataform panel all use it. The workspace picker next to it picks the Dataform workspace used for pull, push, commits and runs. Both choices are remembered per project.