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

RFC: support non-flatpak repositories #37

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions flat-manager-client
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ async def missing_objects(session, build_url, token, wanted):
missing.extend(data["missing"])
return missing

@retry(
wait=wait_fixed(10),
retry=retry_if_exception_type(aiohttp.ClientConnectionError)
)
async def upload_files(session, build_url, token, files):
if len(files) == 0:
return
Expand Down
2 changes: 1 addition & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ fn validate_ref (ref_name: &String, req: &HttpRequest) -> Result<(),ApiError>
}
req.has_token_prefix(ref_parts[1])
},
_ => Err(ApiError::BadRequest(format!("Invalid ref_name {}", ref_name))),
_ => Ok(()), // Err(ApiError::BadRequest(format!("Invalid ref_name {}", ref_name))),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think rather than completely removing the check, it would be better to add a configuration option to disable it.

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe make it non-fatal, but still logged?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think allowing any refs at all is a good idea. Clients can then e.g. replace appstream/x86_64 or other internal "trusted" refs. Allowing some prefix seems better.

}
}

Expand Down
4 changes: 4 additions & 0 deletions src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ impl PublishJobInstance {
.arg(&src_repo_arg)
.arg(&repoconfig.path);

for build_ref in build_refs.iter() {
cmd.arg(&build_ref.ref_name);
}

job_log_and_info(self.job_id, conn,
&format!("Importing build to repo {}", repoconfig.name));
do_command(cmd)?;
Expand Down