Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tarball/trigger): Change tip of branch logic #859

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
12 changes: 4 additions & 8 deletions src/tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,17 @@ def _get_commit_info(self, path, commit, tree, branch):
commit_message = kernelci.build.git_commit_message(
path, commit
)
branch_tip = kernelci.build.git_branch_tip(
path, commit, tree, branch
)
return commit_tags, commit_message, branch_tip
return commit_tags, commit_message

# pylint: disable=too-many-arguments
def _update_node(self, checkout_node, describe, version, tarball_url,
commit_tags, commit_message, branch_tip):
commit_tags, commit_message):
node = checkout_node.copy()
node['data']['kernel_revision'].update({
'describe': describe,
'version': version,
'commit_tags': commit_tags,
'commit_message': commit_message,
'tip_of_branch': branch_tip,
})
node.update({
'state': 'available',
Expand Down Expand Up @@ -244,10 +240,10 @@ def _run(self, sub_id):
tarball_name
)
tarball_url = self._push_tarball(tarball_path)
commit_tags, commit_message, branch_tip = self._get_commit_info(
commit_tags, commit_message = self._get_commit_info(
self._service_config.kdir, commitid, config_tree, config_branch)
self._update_node(checkout_node, describe, version, tarball_url,
commit_tags, commit_message, branch_tip)
commit_tags, commit_message)


class cmd_run(Command):
Expand Down
1 change: 1 addition & 0 deletions src/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def _run_trigger(self, build_config, force, timeout, trees):
'kind': 'checkout',
'data': {
'kernel_revision': revision,
'tip_of_branch': True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This shouldn't be set statically. We should keep it dynamic.

Copy link
Member Author

Choose a reason for hiding this comment

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

In trigger it is by definition tip of tree:

        head_commit = kernelci.build.get_branch_head(build_config)

so it is expected that trigger.py generates only branch head which is same meaning as tip of branch.

},
'timeout': checkout_timeout.isoformat(),
'treeid': treeid,
Expand Down
Loading