Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ Consult the section above to learn more about the structure of the template.

=== Test changes locally

1. Create the directory `work` and run the `test.sh` script.
1. Run the `test.sh` script.
It will automatically delete and recreate a `work` directory.
2. The changes can be examined with `git status`.
When the pull request is later merged into the `main` branch then pull requests with these changes will be created automatically.
3. Depending on the change, it makes sense to run the integration tests for all changed operators.
Expand Down
3 changes: 2 additions & 1 deletion config/retired_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
retired_files:
- python/cargo_version.py
- python/requirements.txt
- flake8 # replaced by ruff
- .flake8 # replaced by ruff
- .github/workflows/pr_reviewdog.yaml # replaced by pr_pre-commit.yaml
21 changes: 10 additions & 11 deletions playbook/update_repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,17 @@
register: git_change
failed_when: git_change.rc == 0 # fail when there are no changes

- name: "Operator [{{ operator.name }}] stage all changes"
command:
argv: [git, add, .]
chdir: "{{ work_dir }}/{{ operator.name }}"

# Check if anything was changed, if yes commit changes and create a pull request, otherwise skip rest of this play
- name: "Operator [{{ operator.name }}] commit changes"
command:
argv: [git, commit, -m, "{{ commit_message }}"]
chdir: "{{ work_dir }}/{{ operator.name }}"

# Fail if the remote branch exists, otherwise push changes and create a pull request
- name: "Operator [{{ operator.name }}] create PR if changes were performed"
block:
- name: "Operator [{{ operator.name }}] run 'git ls-remotes' to ensure that the branch {{ pr_branch_name }} doesn't exist"
Expand All @@ -122,16 +131,6 @@
register: branch_exists
failed_when: branch_exists.rc != 2 # fail when branch exists

- name: "Operator [{{ operator.name }}] stage all changes"
command:
argv: [git, add, .]
chdir: "{{ work_dir }}/{{ operator.name }}"

- name: "Operator [{{ operator.name }}] commit changes"
command:
argv: [git, commit, -a, -m, "{{ commit_message }}"]
chdir: "{{ work_dir }}/{{ operator.name }}"

- name: "Operator [{{ operator.name }}] push changes to branch {{ pr_branch_name }}"
command:
argv: [git, push, --set-upstream, origin, "{{ pr_branch_name }}"]
Expand Down
4 changes: 4 additions & 0 deletions template/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
stackable-secret-operator = attrs: {
buildInputs = [ pkgs.protobuf pkgs.rustfmt ];
};
stackable-opa-user-info-fetcher = attrs: {
# TODO: why is this not pulled in via libgssapi-sys?
buildInputs = [ pkgs.krb5 ];
};
krb5-sys = attrs: {
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.krb5 ];
Expand Down
2 changes: 2 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

rm -fr work || true
mkdir -p work
ansible-playbook playbook/playbook.yaml --tags "local" --extra-vars "gh_access_token=unneeded base_dir=$(pwd) commit_hash=12345 reason='original message'"
Loading