How can I change my dependabot config to exclude major versions - config

This is my dependabot config, is there any way to exclude major version updates and just have minor, patch and security updates? If so what would I need to change?
version: 1
update_configs:
- package_manager: 'javascript'
commit_message:
include_scope: true
prefix: 'chore'
default_reviewers:
- someUser
default_labels:
- 'dependencies'
directory: '/'
target_branch: 'develop'
update_schedule: 'live'

This is now possible although you'll need to update to Dependabot version 2. You can then do something like the following:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#ignore for more information on this.

You can do something like this. We use this to ignore certain versions of certain dependencies.
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- xh3b4sd
ignore:
- dependency-name: k8s.io/*
versions:
- ">=0.19.0"
One problem that I currently try to figure out is how to actually resume updates automatically once they have been ignored. Right now it looks like you have to trigger them manually, which is quite some work when you have many repositories.

Related

dbt- synapse models\example generating error

The problem I’m having is after the profiles.yml All checks passed! (the connection successful)
when i run dbt get this message
Configuration paths exist in your dbt_project.yml file which do not apply to any resources. There are 1 unused configuration paths:- models.dbt_project.example
when I run
dbt --version
Core: - installed: 1.4.1
- latest: 1.4.1 - Up to date!
Plugins: - sqlserver: 1.3.0 - Not compatible!
- synapse: 1.3.2 - Not compatible!
At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
The error message is telling you what is wrong. There is config in your dbt_project.yml file that does not apply to any files in your models directory.
When you run dbt init, it creates some example models (.sql files) in the models/example directory, like my_first_dbt_model.sql. It also adds some example config to dbt_project.yml that looks like this:
# towards the bottom...
models:
your_project_name:
# Config indicated by + and applies to all files under models/example/
example:
+materialized: view
You need to delete the example key, since you deleted that directory. You could also delete the keys above it, or keep them, since you'll probably add config at some point.
The OTHER error is probably because you installed dbt-core separately from dbt-synapse. You should delete your virtual environment and start over by just running pip install dbt-synapse, which will automatically install a compatible version of dbt-core. You should NEVER pin versions of dbt-core, only the version of your adapter (since the adapter will specify its compatible versions of dbt-core).

How to configure renovate to switch from gitlab-release to git-tags

My goal is to update all includes in my gitlab-ci.yml files. By default without any custom configuration renovate create MR with an include update based on gitlab-release.
But today, I have some includes only based on tag and there isn't any release associated to this tag. I looking for a solution to update also these includes.
To explain, if I have a release for myprojet named 1.2.3 and tag 1.2 and 1
include:
# Bash template
- project: "myproject"
ref: "1.2.2"
file: "templates/gitlab-ci.yml"
renovate detects there is a new release on 1.2.3 - It's OK
If I have :
include:
# Bash template
- project: "myproject"
ref: "1.1"
file: "templates/gitlab-ci.yml"
renovate don't detect tag named 1.2 for myproject
have you tried regex managers?
here's an example, change it for your needs:
"regexManagers": [
{
"fileMatch": ["(^|/)\\.?gitlab-ci\\.yml$"],
"matchStringsStrategy": "combination",
"matchStrings": [
"\\s\\sCHART_SOURCES_URL: \"(?<depName>.*?)\"\n",
"\\s\\sCHART_SOURCES_VERSION: \"(?<currentValue>.*?)\"\n"
],
"datasourceTemplate": "git-tags"
}
],
i believe you could also set enabled=false for the actual gitlab-ci manager using matchManagers in package rules

How do I add comments to .gitlab-ci.yaml file?

I tried commenting out some lines from a .gitlab-ci.yml file and the pipeline is failing saying the YAML is not properly formatted.
Below is the picture of what I see in the GitLab CI-Pipeline UI.
Below is the .gitlab-ci.yml file that is error.
stages:
- build
- test
# - release
build-demo-commands:
extends: .npm-job
stage: build
script:
- npm run build-demo-prod
include:
- project: 'myproj/gitlab-ci'
ref: '1.2.0'
file: 'templates/npm.gitlab-ci.yml'
# - project: 'myproj/gitlab-ci'
# ref: '1.2.0'
# file: 'templates/Kaniko-npm.gitlab-ci.yml'
I suspect that there is a pre-processor for the CI-pipeline which supports a comment syntax.
What is the correct way to comment out lines in a .gitlab-ci.yml file?
Searching for answer
I found this Add comments to .gitlab-ci.yml, which was merged two years ago. Now I just need to find the page that says how to do it!
https://docs.gitlab.com/ee/development/code_comments.html - not helpful
https://docs.gitlab.com/ee/development/cicd/templates.html#template-types -
https://docs.gitlab.com/ee/development/cicd/templates.html#explain-the-template-with-comments - Looks like the answer so why does it complain?
https://blog.wplauncher.com/add-comments-to-yaml-file/#:~:text=In%20order%20to%20add%20comments,line%20in%20a%20YAML%20file. This says the # is the way to do comments.
EDIT/UPDATE:
I believe the problem is with the included scripts and not with adding the comments. When I removed the comments I still got an error. The error was:
Found errors in your .gitlab-ci.yml:
npm-deploy-snapshot job: chosen stage does not exist; available stages are .pre
build
test
.post
You can also test your .gitlab-ci.yml in CI Lint
So I now believe that using the hash (#) character is the correct way to comment a .gitlab-ci.yml file.
Comments in YAML use a # character which comments out the remainder of the line
Wikipedia says:
Comments begin with the number sign (#), can start anywhere on a line and continue until the end of the line. Comments must be separated from other tokens by whitespace characters.[16] If # characters appear inside of a string, then they are number sign (#) literals.

Filebeat rename fields example

Using filebeat 6.8 open source version, I'm trying to use the field rename feature. I'm not seeing any errors in startup or processing, but the field isn't getting renamed. The logs are JSON formatted. Am I missing something in my config, or is this combination not supported yet?
filebeat.yml
processors:
- rename:
fields:
- from: "a"
to: "b"
filebeat.inputs:
- type: log
enabled: true
json.keys_under_root: true
fields_under_root: true
sample log
{
"a": "blah"
}
Edit:
According to the official documentation, processors can be placed at top level or under an input.
So, perhaps what your configuration is missing is the file paths to prospect.
I'm running filebeat 7.6.2 and I use this feature without any issues, but I'm pretty sure it works on version 6.8 just as well since these fields are documented for this version. See here.
Have you tried:
filebeat.inputs:
- type: log
paths:
- /path/to/your/logs
enabled: true
json.keys_under_root: true
fields_under_root: true
processors:
- rename:
fields:
- from: "a"
to: "b"
Processors should be declared after inputs AFAIK. As for not seeing any errors, I'm not sure how far beyond simple yaml linting filebeat goes when it comes to validating your configuration file.

Rails 3: Social Stream - Sphinx Install Error

I have created a new app in Rails 3.2.5, ran "bundle", then "rails
generate social_stream:install"
I got the following message:
Sphinx cannot be found on your system. You may need to configure the
following
settings in your config/sphinx.yml file:
* bin_path
* searchd_binary_name
* indexer_binary_name
==============================
My sphinx.yml looks like this:
development:
enable_star: 1
min_infix_len: 1
test:
enable_star: 1
min_infix_len: 1
production:
enable_star: 1
min_infix_len: 1
===============================
I went to: http://freelancing-god.github.com/ts/en/advanced_config.html
and looked for an appropriate config to allow me to continue moving
forward with Social_Stream, but I am stuck at this point.
Does anyone know of a config that will allow you to get pass this
error message?
What operating system are you using?
Have you actually installed the appropriate binaries?
Install Sphinx on your system. If you are using homebrew you can run the following:
brew install sphinx