Skip to content

set environment vars in bpipe fd plugin#2205

Merged
BareosBot merged 15 commits intobareos:masterfrom
pstorz:dev/pstorz/master/envvars_in_bpipe-fd_plugin
Sep 3, 2025
Merged

set environment vars in bpipe fd plugin#2205
BareosBot merged 15 commits intobareos:masterfrom
pstorz:dev/pstorz/master/envvars_in_bpipe-fd_plugin

Conversation

@pstorz
Copy link
Member

@pstorz pstorz commented Mar 10, 2025

Thank you for contributing to the Bareos Project!

This PR sets the environment variables for the joblevel, jobid, job-type client-name and since-time for the bpipe plugin, so that the reader program and the writer program get this information.

Also it adds a systemtests for the bpipe plugin that tests the environment variables.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@sebsura sebsura added the draft label Apr 17, 2025
@florian-at-bareos florian-at-bareos force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from a2a8c8d to 978644c Compare June 3, 2025 08:00
@florian-at-bareos florian-at-bareos added this to the 25.0.0 milestone Jun 3, 2025
@florian-at-bareos florian-at-bareos marked this pull request as draft June 3, 2025 08:04
@florian-at-bareos florian-at-bareos force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from 978644c to 375872c Compare June 3, 2025 08:36
@florian-at-bareos florian-at-bareos marked this pull request as ready for review June 18, 2025 08:31
@sebsura sebsura assigned pstorz and unassigned florian-at-bareos Jun 23, 2025
@sebsura sebsura self-requested a review June 23, 2025 09:13
@sebsura sebsura force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from fda3e65 to 4dee0ef Compare June 23, 2025 13:29
@pstorz pstorz force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from 2d1a9be to e5d3a8b Compare August 18, 2025 14:08
@pstorz pstorz requested a review from sebsura August 19, 2025 08:28
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good, but I think we should test two more facts:

  1. bpipe-fd is supposed to add to the environment, and not replace it
  2. bpipe-fd is supposed to overwrite the environment on conflict.

This can be easily tested the following way:

create an environment.local file that contains

# these should get overwritten in bpipe-fd
export BareosClientName='-1'
export BareosJobId='-1'
export BareosJobLevel='-1'
export BareosSinceTime='-1'
export BareosJobType='-1'

# this should be preserved inside bpipe-fd
export my_env_variable="still there"

Then we simply need to change the reader/writer program to also output "my_env_variable" and check in the testrunner that it indeed has the right value.

@arogge arogge requested a review from sebsura August 26, 2025 10:41
@sebsura sebsura force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from dc45c69 to f7b06f1 Compare August 29, 2025 07:09
@pstorz pstorz force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch 3 times, most recently from ea2e1f9 to ae8adc6 Compare September 1, 2025 09:05
@pstorz pstorz force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from ae8adc6 to 81f9874 Compare September 2, 2025 08:01
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

the following variables are added:
- client name ($BareosClientName)
- job id ($BareosJobId)
- job level ($BareosJobLevel)
- since time for differntial/incremental $(BareosSinceTime)
- job type ($BareosJobType)
Also add .in to config file extensions.
florian-at-bareos and others added 10 commits September 3, 2025 08:59
from writeprogram and instead use "tmp/"
- remove comments from config
- fix date in cmake list
- added incremental backup run
- write to individual files for Full and Inc
- do not read backup environment vars from restored data but
  from immediately written files
- verify plausibility of BareosSinceTime
- write to std log file names to be able to use check_two_logs()
freebsds date uses different format specifiers.
This was done this way as there is no easy way for a single testrunner
to access the environment that the nssm service is created with.
@sebsura sebsura force-pushed the dev/pstorz/master/envvars_in_bpipe-fd_plugin branch from 81f9874 to c8d926e Compare September 3, 2025 07:05
@BareosBot BareosBot merged commit 7bd2e7b into bareos:master Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants