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

👷 add job to update open-api-framework #4

Merged
merged 14 commits into from
Jan 3, 2025
Merged

Conversation

@Coperh Coperh force-pushed the feature/udate-oaf-pr branch 4 times, most recently from 40139a4 to d8c6fee Compare November 13, 2024 09:18
@Coperh
Copy link
Contributor Author

Coperh commented Nov 13, 2024

I just realised I misspelled my branch :(

@Coperh Coperh force-pushed the feature/udate-oaf-pr branch 11 times, most recently from 4a6fa8b to 7514ef2 Compare November 13, 2024 13:19
@Coperh
Copy link
Contributor Author

Coperh commented Nov 13, 2024

This feels very hacky and is implemented though trial and error.

Action steps do not support conditionals really and this code requires a lot of conditionals.

I probably should have create a python script but I had already spend a lot of time on this :/

@Coperh Coperh force-pushed the feature/udate-oaf-pr branch from 7514ef2 to 8668d06 Compare November 13, 2024 14:13
Comment on lines 91 to 94
if [[ $(gh pr list --json title | grep '\"title\"') ]]; then
echo "EXISTS=true" >> $GITHUB_ENV
else
echo "EXISTS=false" >> $GITHUB_ENV
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe other conditionals should be written like this?

Copy link
Contributor

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

I probably should have create a python script but I had already spend a lot of time on this :/

would it be a lot of work to rewrite this as a python or bash script?

.github/workflows/oaf-check.yml Outdated Show resolved Hide resolved
.github/workflows/oaf-check.yml Outdated Show resolved Hide resolved
.github/workflows/oaf-check.yml Outdated Show resolved Hide resolved
@Coperh
Copy link
Contributor Author

Coperh commented Nov 14, 2024

@stevenbal it should be quite quick to rewrite fully in bash since it is basically already in bash and does not install anything other than python.

Maybe python as well? Not sure but it would give me greater control.

I was going to do it later in my own time cause it is annoying me.

Also note for myself: git diff works between branches

@stevenbal
Copy link
Contributor

@Coperh If it's possible to make it a python script that would probably be my preference, it seems easier than working with conditionals in GH actions

@Coperh Coperh force-pushed the feature/udate-oaf-pr branch 2 times, most recently from 045836f to 678abb4 Compare November 17, 2024 21:21
@Coperh Coperh force-pushed the feature/udate-oaf-pr branch 3 times, most recently from 5f70adf to 129f185 Compare December 2, 2024 10:47
@Coperh
Copy link
Contributor Author

Coperh commented Dec 2, 2024

After trying to implement Steven's suggestion. I released that it did not work.

Apparently git diff returning an output counts as true even with exit code 1. Also I do not think git commit worked either.

Refactored it and it should be much cleaner now.

Will tag the last commit and pin the action to that tag when approved.

@Coperh Coperh requested a review from stevenbal December 2, 2024 11:03
@Coperh
Copy link
Contributor Author

Coperh commented Dec 2, 2024

Same PR is used. The ones by me are testing locally.

run: echo "OAF_VERSION=$(grep -Po '(?<=open-api-framework==)[^\n]*' requirements/dev.txt)" >> $GITHUB_ENV
- name: Create Update PR
if: failure()
uses: maykinmedia/open-api-workflows/actions/create-update-pr@feature/udate-oaf-pr
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably good to do this as the last bit of work. You could also tag a beta/alpha version to check if things work.

actions/create-update-pr/create-update-pr.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this file being called? Is it defined in the down stream project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's called in check .github/workflows/oaf-check.yml in this PR which is then called for exam le here: https://github.com/Coperh/objects-api/blob/master/.github/workflows/oaf-check.yml

actions/create-update-pr/create-update-pr.sh Outdated Show resolved Hide resolved
actions/create-update-pr/create-update-pr.sh Outdated Show resolved Hide resolved
actions/create-update-pr/create-update-pr.sh Outdated Show resolved Hide resolved
.github/workflows/oaf-check.yml Outdated Show resolved Hide resolved
@Coperh Coperh force-pushed the feature/udate-oaf-pr branch 3 times, most recently from fd25ccb to 32df52e Compare December 30, 2024 13:17
@Coperh Coperh force-pushed the feature/udate-oaf-pr branch from 32df52e to 223f118 Compare December 30, 2024 13:30
@Coperh Coperh force-pushed the feature/udate-oaf-pr branch from 7c429c2 to 38e3aa3 Compare December 30, 2024 13:39
@Coperh Coperh requested a review from SonnyBA December 30, 2024 13:51
@Coperh
Copy link
Contributor Author

Coperh commented Dec 30, 2024

Changed to use the full command option names.

Will tag after approval

Copy link
Contributor

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

Looks good!

@Coperh Coperh merged commit f802c96 into main Jan 3, 2025
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.

Script to check if all components use the latest OAf
3 participants