Compare commits
3 Commits
env-disabl
...
ci-experim
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
cfb1bc2fe9 | ||
| b04755c667 | |||
|
1fc0be5f60
|
@@ -30,31 +30,167 @@ jobs:
|
||||
git fetch origin ${{ gitea.ref }}
|
||||
git checkout FETCH_HEAD
|
||||
working-directory: ./autogits
|
||||
- name: Prepare binaries
|
||||
- name: Prepare binaries (baseline)
|
||||
run: make build
|
||||
working-directory: ./autogits
|
||||
- name: Prepare images
|
||||
- name: Prepare images (baseline)
|
||||
run: |
|
||||
make build
|
||||
podman rmi $(podman images -f "dangling=true" -q)
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down
|
||||
- name: Make sure the pod is down (1)
|
||||
run: make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Start images
|
||||
- name: Start images (baseline)
|
||||
run: |
|
||||
make up
|
||||
make wait_healthy
|
||||
podman ps
|
||||
sleep 5
|
||||
working-directory: ./autogits/integration
|
||||
- name: Run tests
|
||||
run: make pytest
|
||||
- name: Run tests 30 times (baseline)
|
||||
run: |
|
||||
pass=0
|
||||
fail=0
|
||||
for i in $(seq 1 30); do
|
||||
echo "Iteration $i/30..."
|
||||
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
|
||||
pass=$((pass + 1))
|
||||
else
|
||||
fail=$((fail + 1))
|
||||
fi
|
||||
done
|
||||
echo "Summary (baseline): $pass passes, $fail failures"
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down
|
||||
- name: Make sure the pod is down (2)
|
||||
run: |
|
||||
podman ps
|
||||
make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Cherry-pick 1
|
||||
run: |
|
||||
git config user.email "bot@example.com"
|
||||
git config user.name "Bot"
|
||||
git cherry-pick 572e33111bd72518f33ec4f7c93a7222282f43999afafac948e1e3da5c3453a0
|
||||
working-directory: ./autogits
|
||||
- name: Prepare binaries (after CP1)
|
||||
run: make build
|
||||
working-directory: ./autogits
|
||||
- name: Prepare images (after CP1)
|
||||
run: |
|
||||
make build
|
||||
podman rmi $(podman images -f "dangling=true" -q)
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down (3)
|
||||
run: make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Start images (after CP1)
|
||||
run: |
|
||||
make up
|
||||
make wait_healthy
|
||||
podman ps
|
||||
sleep 5
|
||||
working-directory: ./autogits/integration
|
||||
- name: Run tests 30 times (after CP1)
|
||||
run: |
|
||||
pass=0
|
||||
fail=0
|
||||
for i in $(seq 1 30); do
|
||||
echo "Iteration $i/30..."
|
||||
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
|
||||
pass=$((pass + 1))
|
||||
else
|
||||
fail=$((fail + 1))
|
||||
fi
|
||||
done
|
||||
echo "Summary (after CP1): $pass passes, $fail failures"
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down (4)
|
||||
run: |
|
||||
podman ps
|
||||
make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Cherry-pick 2
|
||||
run: |
|
||||
git cherry-pick 8fa732e67518769c9a962e6d12c2e70b38f7bc06e26332fb007ac666fa5e38c1
|
||||
working-directory: ./autogits
|
||||
- name: Prepare binaries (after CP2)
|
||||
run: make build
|
||||
working-directory: ./autogits
|
||||
- name: Prepare images (after CP2)
|
||||
run: |
|
||||
make build
|
||||
podman rmi $(podman images -f "dangling=true" -q)
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down (5)
|
||||
run: make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Start images (after CP2)
|
||||
run: |
|
||||
make up
|
||||
make wait_healthy
|
||||
podman ps
|
||||
sleep 5
|
||||
working-directory: ./autogits/integration
|
||||
- name: Run tests 30 times (after CP2)
|
||||
run: |
|
||||
pass=0
|
||||
fail=0
|
||||
for i in $(seq 1 30); do
|
||||
echo "Iteration $i/30..."
|
||||
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
|
||||
pass=$((pass + 1))
|
||||
else
|
||||
fail=$((fail + 1))
|
||||
fi
|
||||
done
|
||||
echo "Summary (after CP2): $pass passes, $fail failures"
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down (6)
|
||||
run: |
|
||||
podman ps
|
||||
make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Discard and Cherry-pick 3
|
||||
run: |
|
||||
git reset --hard FETCH_HEAD
|
||||
git cherry-pick 58f410befce4da40f3ebc27e21ac81a55b6425dd4214e08eb59359d54322a29d
|
||||
working-directory: ./autogits
|
||||
- name: Prepare binaries (after CP3)
|
||||
run: make build
|
||||
working-directory: ./autogits
|
||||
- name: Prepare images (after CP3)
|
||||
run: |
|
||||
make build
|
||||
podman rmi $(podman images -f "dangling=true" -q)
|
||||
working-directory: ./autogits/integration
|
||||
- name: Make sure the pod is down (7)
|
||||
run: make down
|
||||
working-directory: ./autogits/integration
|
||||
- name: Start images (after CP3)
|
||||
run: |
|
||||
make up
|
||||
make wait_healthy
|
||||
podman ps
|
||||
sleep 5
|
||||
working-directory: ./autogits/integration
|
||||
- name: Run tests 30 times (after CP3)
|
||||
run: |
|
||||
pass=0
|
||||
fail=0
|
||||
for i in $(seq 1 30); do
|
||||
echo "Iteration $i/30..."
|
||||
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
|
||||
pass=$((pass + 1))
|
||||
else
|
||||
fail=$((fail + 1))
|
||||
fi
|
||||
done
|
||||
echo "Summary (after CP3): $pass passes, $fail failures"
|
||||
working-directory: ./autogits/integration
|
||||
- name: Final cleanup
|
||||
if: always()
|
||||
run: |
|
||||
podman ps
|
||||
make down
|
||||
working-directory: ./autogits/integration
|
||||
|
||||
|
||||
8
Makefile
8
Makefile
@@ -1,4 +1,8 @@
|
||||
MODULES := devel-importer utils/hujson utils/maintainer-update gitea-events-rabbitmq-publisher gitea_status_proxy group-review obs-forward-bot obs-staging-bot obs-status-service workflow-direct workflow-pr
|
||||
|
||||
build:
|
||||
for m in $(MODULES); do go build -C $$m -buildmode=pie || exit 1 ; done
|
||||
.PHONY: build $(MODULES)
|
||||
|
||||
build: $(MODULES)
|
||||
|
||||
$(MODULES):
|
||||
go build -C $@ -buildmode=pie
|
||||
|
||||
@@ -857,13 +857,12 @@ func (gitea *GiteaTransport) ResetTimelineCache(org, repo string, idx int64) {
|
||||
func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models.TimelineComment, error) {
|
||||
page := int64(1)
|
||||
resCount := 1
|
||||
disableCache := GetEnvOverrideBool(os.Getenv("AUTOGITS_TIMELINE_CACHE_DISABLE"), false)
|
||||
|
||||
prID := fmt.Sprintf("%s/%s!%d", org, repo, idx)
|
||||
giteaTimelineCacheMutex.RLock()
|
||||
TimelineCache, IsCached := giteaTimelineCache[prID]
|
||||
var LastCachedTime strfmt.DateTime
|
||||
if IsCached && !disableCache {
|
||||
if IsCached {
|
||||
l := len(TimelineCache.data)
|
||||
if l > 0 {
|
||||
LastCachedTime = TimelineCache.data[0].Updated
|
||||
@@ -880,10 +879,6 @@ func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models
|
||||
giteaTimelineCacheMutex.Lock()
|
||||
defer giteaTimelineCacheMutex.Unlock()
|
||||
|
||||
if disableCache {
|
||||
TimelineCache = TimelineCacheData{}
|
||||
}
|
||||
|
||||
for resCount > 0 {
|
||||
opts := issue.NewIssueGetCommentsAndTimelineParams().WithOwner(org).WithRepo(repo).WithIndex(idx).WithPage(&page)
|
||||
if !LastCachedTime.IsZero() {
|
||||
|
||||
@@ -95,7 +95,6 @@ services:
|
||||
- AMQP_USERNAME=gitea
|
||||
- AMQP_PASSWORD=gitea
|
||||
- SSL_CERT_FILE=/usr/share/pki/trust/anchors/gitea-rabbitmq-ca.crt
|
||||
- AUTOGITS_TIMELINE_CACHE_DISABLE=1
|
||||
volumes:
|
||||
- ./gitea-data:/var/lib/gitea:ro,z
|
||||
- ./workflow-pr/workflow-pr.json:/etc/workflow-pr.json:ro,z
|
||||
|
||||
@@ -139,6 +139,7 @@ index 00000000..473a0f4c
|
||||
|
||||
|
||||
@pytest.mark.t005
|
||||
# @pytest.mark.xfail(reason="TBD troubleshoot")
|
||||
def test_005_any_maintainer_approval_sufficient(maintainer_env, ownerA_client, ownerBB_client):
|
||||
"""
|
||||
Test scenario:
|
||||
@@ -200,6 +201,7 @@ index 00000000..473a0f4c
|
||||
|
||||
|
||||
@pytest.mark.t006
|
||||
@pytest.mark.xfail(reason="tbd flacky in ci")
|
||||
def test_006_maintainer_rejection_removes_other_requests(maintainer_env, ownerA_client, ownerBB_client):
|
||||
"""
|
||||
Test scenario:
|
||||
|
||||
Reference in New Issue
Block a user