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

Multipart static files #342

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Sep 29, 2023

Depend on #340, please review it first, otherwise the tests are always failed.

This was referenced Sep 29, 2023
Copy link

@JP-Ellis JP-Ellis left a comment

Choose a reason for hiding this comment

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

Generally looks all good to me. Just a couple of comments (see below) before I formally approve it 👍

Choose a reason for hiding this comment

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

What is the purpose of this file?

Copy link
Contributor Author

@tienvx tienvx Oct 12, 2023

Choose a reason for hiding this comment

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

pactffi_with_multipart_file_v2 require path to the part's file.

Instead of creating temporary files using code, I put the content into pre-created files, so no need those ugly code.

The purpose of those files:

  • full_name.txt
  • image.jpg
  • note.txt

are just for demo that the multipart request POST /user-profile has 3 parts: full_name, profile_image and personal_note. Nothing special about it really.

Choose a reason for hiding this comment

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

My oversight, I didn't fully absorb the full path name 😅 Makes complete sense!

Choose a reason for hiding this comment

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

And similarly, this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing special about these file. It's just for testing that I can actually send multiple parts in a multipart request.

@JP-Ellis
Copy link

Related to this PR, you mention that this PR depends on another. In case you didn't know, it is possible to point the target to another PR (as opposed to the ffi branch). This then prevents accidentally merging secondary PR without the primary PR being merged first :)

@YOU54F
Copy link
Member

YOU54F commented Oct 12, 2023

So this PR just removes the temp file creation during tests, and uses static files instead.

If I was being picky I would probably say it would be nice to follow a conventional commit standard so say

deps: update pact ffi to 0.4.9
fix: xyz

etc. However there are no current commit convention guidelines in this repo, and the original author doesn't follow those conventions, so it would unfair to block that!

and as this is fully tested, in an alpha branch, i'm okay with the lib update, especially as 0.4.8 of the ffi is missing our linux aarch64 builds and its good to get the latest release tested

@YOU54F YOU54F self-requested a review October 12, 2023 15:26
@YOU54F YOU54F merged commit adeec02 into pact-foundation:ffi Oct 12, 2023
26 checks passed
@tienvx
Copy link
Contributor Author

tienvx commented Oct 13, 2023

I will follow that standard. Thanks @YOU54F

@tienvx tienvx deleted the multipart-static-files branch October 13, 2023 01:56
@JP-Ellis
Copy link

If you want to read more about it, you can check it out at conventionalcommit.org

I remember when switching to this initially, it was a little weird; but now that I use it consistently, it makes git logs so much easier to parse quickly 😁 Plus there's a bunch of tooling out there that make use of a conventional commit log to generate things like changelogs.

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.

3 participants