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

tasks: Add cockpituous refs/heads/main mock API endpoint #597

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

martinpitt
Copy link
Member

job-runner needs that for cross-project testing [1]. A clean way would be to actually resolve "main" to a current SHA in the test, but as nothing actually cares, just rely on the main fallback for now -- nothing cares whether this is an actual SHA, as most things in git are happy with a "ref" -- and we don't use that to post statuses (and that would fail because the mock doesn't provide these paths).

[1] cockpit-project/bots#6066


This unblocks cockpit-project/bots#6066

job-runner needs that for cross-project testing [1]. A clean way would
be to actually resolve "main" to a current SHA in the test, but as
nothing actually cares, just rely on the `main` fallback for now --
nothing cares whether this is an actual SHA, as most things in git are
happy with a "ref" -- and we don't use that to post statuses (and that
would fail because the mock doesn't provide these paths).

[1] cockpit-project/bots#6066
@martinpitt
Copy link
Member Author

@allisonkarlitskaya If this is too smelly for you, I'm happy to put in the SHA resolution, but I'm more of a "build it only when needed" kind of guy 😁

@allisonkarlitskaya
Copy link
Member

@allisonkarlitskaya If this is too smelly for you, I'm happy to put in the SHA resolution, but I'm more of a "build it only when needed" kind of guy 😁

From IRC this morning:

and martin be all like return "main" # hax lol

# for cross-project test; job-runner uses it to determine the clone SHA
'/repos/cockpit-project/cockpituous/git/refs/heads/main': {
# that fallback is strictly wrong, but good enough
'object': {'sha': args.cockpituous_sha or "main"},
Copy link
Member

Choose a reason for hiding this comment

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

I considered checking this for validity on receipt, but meh. If it works, it works. It's just mocking, after all.

I'm more bothered by the ad-hoc way in which we keep adding stuff here. I want git-serve.

@allisonkarlitskaya allisonkarlitskaya merged commit f3aecf3 into main Mar 12, 2024
3 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the cross-project-gh-api branch March 12, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants