Compare commits
4 Commits
cherry-3e4
...
codman
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e07c2b5fa0 | ||
|
|
f97e194c3f | ||
|
|
1430d6f339 | ||
|
|
ac672ee117 |
@@ -955,6 +955,7 @@ trigger_snap_builds:
|
|||||||
- echo "$LAUNCHPAD_SSH_KEY" | sed 's/\\n/\n/g' > ~/.ssh/id_rsa
|
- echo "$LAUNCHPAD_SSH_KEY" | sed 's/\\n/\n/g' > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- ssh-keyscan git.launchpad.net >> ~/.ssh/known_hosts
|
- ssh-keyscan git.launchpad.net >> ~/.ssh/known_hosts
|
||||||
|
- ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||||
- eval "$(ssh-agent -s)"
|
- eval "$(ssh-agent -s)"
|
||||||
- ssh-add ~/.ssh/id_rsa
|
- ssh-add ~/.ssh/id_rsa
|
||||||
- git config --global user.name "GitLab CI"
|
- git config --global user.name "GitLab CI"
|
||||||
@@ -972,3 +973,9 @@ trigger_snap_builds:
|
|||||||
git commit --allow-empty -m "Trigger build: U-Boot updated to $CI_COMMIT_SHORT_SHA"
|
git commit --allow-empty -m "Trigger build: U-Boot updated to $CI_COMMIT_SHORT_SHA"
|
||||||
git push origin master
|
git push origin master
|
||||||
echo "Snap build triggers completed"
|
echo "Snap build triggers completed"
|
||||||
|
|
||||||
|
echo "Pushing to GitHub u-boot-concept for ReadTheDocs..."
|
||||||
|
cd $CI_PROJECT_DIR
|
||||||
|
git remote add github git@github.com:sjg20/u-boot-concept.git || true
|
||||||
|
git push github HEAD:master --force
|
||||||
|
echo "GitHub push completed"
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ def parse_args(argv):
|
|||||||
help='Git remote (default: ci)')
|
help='Git remote (default: ci)')
|
||||||
push_cmd.add_argument('-f', '--force', action='store_true',
|
push_cmd.add_argument('-f', '--force', action='store_true',
|
||||||
help='Force push (overwrite remote branch)')
|
help='Force push (overwrite remote branch)')
|
||||||
|
push_cmd.add_argument('--run-ci', action='store_true',
|
||||||
|
help='Run CI pipeline (default: skip for new MRs)')
|
||||||
|
|
||||||
test_cmd = subparsers.add_parser('test', help='Run tests')
|
test_cmd = subparsers.add_parser('test', help='Run tests')
|
||||||
test_cmd.add_argument('-P', '--processes', type=int,
|
test_cmd.add_argument('-P', '--processes', type=int,
|
||||||
|
|||||||
@@ -234,8 +234,8 @@ Steps to follow:
|
|||||||
4. Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify the build
|
4. Run 'buildman -L --board sandbox -w -o /tmp/pickman' to verify the build
|
||||||
5. Create a local branch with suffix '-v2' (or increment: -v3, -v4, etc.)
|
5. Create a local branch with suffix '-v2' (or increment: -v3, -v4, etc.)
|
||||||
6. Force push to the ORIGINAL remote branch to update the MR:
|
6. Force push to the ORIGINAL remote branch to update the MR:
|
||||||
./tools/pickman/pickman push-branch {branch_name} -r {remote} -f
|
./tools/pickman/pickman push-branch {branch_name} -r {remote} -f --run-ci
|
||||||
(this triggers a new pipeline to verify the changes)
|
(--run-ci triggers a pipeline to verify the rebased changes)
|
||||||
7. Report what was done and what reply should be posted to the MR
|
7. Report what was done and what reply should be posted to the MR
|
||||||
|
|
||||||
Important:
|
Important:
|
||||||
@@ -243,6 +243,7 @@ Important:
|
|||||||
- If a comment is unclear or cannot be addressed, note this in your report
|
- If a comment is unclear or cannot be addressed, note this in your report
|
||||||
- Local branch: {branch_name}-v2 (or -v3, -v4 etc.)
|
- Local branch: {branch_name}-v2 (or -v3, -v4 etc.)
|
||||||
- Remote push: always to '{branch_name}' to update the existing MR
|
- Remote push: always to '{branch_name}' to update the existing MR
|
||||||
|
- Always use --run-ci when pushing rebases/updates to trigger verification
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -783,13 +783,16 @@ def do_push_branch(args, dbs): # pylint: disable=unused-argument
|
|||||||
pickman commits come from the same account.
|
pickman commits come from the same account.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
args (Namespace): Parsed arguments with 'remote', 'branch', 'force'
|
args (Namespace): Parsed arguments with 'remote', 'branch', 'force',
|
||||||
|
'run_ci'
|
||||||
dbs (Database): Database instance
|
dbs (Database): Database instance
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int: 0 on success, 1 on failure
|
int: 0 on success, 1 on failure
|
||||||
"""
|
"""
|
||||||
success = gitlab_api.push_branch(args.remote, args.branch, args.force)
|
skip_ci = not getattr(args, 'run_ci', False)
|
||||||
|
success = gitlab_api.push_branch(args.remote, args.branch, args.force,
|
||||||
|
skip_ci=skip_ci)
|
||||||
return 0 if success else 1
|
return 0 if success else 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ def get_push_url(remote):
|
|||||||
return f'https://oauth2:{token}@{host}/{proj_path}.git'
|
return f'https://oauth2:{token}@{host}/{proj_path}.git'
|
||||||
|
|
||||||
|
|
||||||
def push_branch(remote, branch, force=False):
|
def push_branch(remote, branch, force=False, skip_ci=True):
|
||||||
"""Push a branch to a remote
|
"""Push a branch to a remote
|
||||||
|
|
||||||
Uses the GitLab API token for authentication if available, so the push
|
Uses the GitLab API token for authentication if available, so the push
|
||||||
@@ -182,6 +182,9 @@ def push_branch(remote, branch, force=False):
|
|||||||
remote (str): Remote name
|
remote (str): Remote name
|
||||||
branch (str): Branch name
|
branch (str): Branch name
|
||||||
force (bool): Force push (overwrite remote branch)
|
force (bool): Force push (overwrite remote branch)
|
||||||
|
skip_ci (bool): Skip CI pipeline (default True for new MRs where
|
||||||
|
MR pipeline runs automatically; set False for updates that
|
||||||
|
need pipeline verification)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
bool: True on success
|
bool: True on success
|
||||||
@@ -191,10 +194,17 @@ def push_branch(remote, branch, force=False):
|
|||||||
push_url = get_push_url(remote)
|
push_url = get_push_url(remote)
|
||||||
push_target = push_url if push_url else remote
|
push_target = push_url if push_url else remote
|
||||||
|
|
||||||
# Skip push pipeline; MR pipeline will run when MR is created
|
# When using --force-with-lease with an HTTPS URL (not remote name),
|
||||||
args = ['git', 'push', '-u', '-o', 'ci.skip']
|
# git can't find tracking refs automatically. Fetch first to update
|
||||||
|
# the tracking ref, then explicitly specify which ref to check.
|
||||||
|
if force and push_url:
|
||||||
|
command.output('git', 'fetch', remote, branch)
|
||||||
|
|
||||||
|
args = ['git', 'push', '-u']
|
||||||
|
if skip_ci:
|
||||||
|
args.extend(['-o', 'ci.skip'])
|
||||||
if force:
|
if force:
|
||||||
args.append('--force-with-lease')
|
args.append(f'--force-with-lease=refs/remotes/{remote}/{branch}')
|
||||||
args.extend([push_target, f'HEAD:{branch}'])
|
args.extend([push_target, f'HEAD:{branch}'])
|
||||||
command.output(*args)
|
command.output(*args)
|
||||||
return True
|
return True
|
||||||
@@ -284,7 +294,9 @@ def get_pickman_mrs(remote, state='opened'):
|
|||||||
glab = gitlab.Gitlab(f'https://{host}', private_token=token)
|
glab = gitlab.Gitlab(f'https://{host}', private_token=token)
|
||||||
project = glab.projects.get(proj_path)
|
project = glab.projects.get(proj_path)
|
||||||
|
|
||||||
mrs = project.mergerequests.list(state=state, get_all=True)
|
# Sort by created_at ascending so oldest MRs are processed first
|
||||||
|
mrs = project.mergerequests.list(state=state, order_by='created_at',
|
||||||
|
sort='asc', get_all=True)
|
||||||
pickman_mrs = []
|
pickman_mrs = []
|
||||||
for merge_req in mrs:
|
for merge_req in mrs:
|
||||||
if '[pickman]' in merge_req.title:
|
if '[pickman]' in merge_req.title:
|
||||||
|
|||||||
Reference in New Issue
Block a user