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

.github/workflows/README.md outdated. #2074

Closed
Jakio815 opened this issue Oct 21, 2023 · 18 comments
Closed

.github/workflows/README.md outdated. #2074

Jakio815 opened this issue Oct 21, 2023 · 18 comments

Comments

@Jakio815
Copy link
Collaborator

Jakio815 commented Oct 21, 2023

Looks like this is outdated. The ci.yml does not exist anymore.

Could anyone help updating this? I'm not sure how I can make my work in reactor-c get reflected in the CI tests.

@axmmisaka
Copy link
Collaborator

Maybe try specifying runtime-ref?

@Jakio815
Copy link
Collaborator Author

Maybe try specifying runtime-ref?

@axmmisaka Should I just change it to true? Will it checkout the submodule I updated?

@axmmisaka
Copy link
Collaborator

I think it takes a ref, i.e. branch name or SHA

@Jakio815
Copy link
Collaborator Author

In .github/workflows/c-tests.yml

...
      runtime-ref:
        required: true
        type: string

...
      - name: Check out specific ref of reactor-c
        uses: actions/checkout@v3
        with:
          repository: lf-lang/reactor-c
          path: core/src/main/resources/lib/c/reactor-c
          # ref: ${{ inputs.runtime-ref }}
          ref: 'my_branch'
        if: ${{ inputs.runtime-ref }}
...

I think this part is where we should change, but it's not actually working.
The if state should be true, which I changed it from the inputs.runtime-ref, and I don't know where I should point my branch.

I also tried just leaving ref: ${{ inputs.runtime-ref }} but still does not work.

@lhstrh
Copy link
Member

lhstrh commented Oct 25, 2023

@Jakio815, I agree that the docs you pointed to are out of date. We can update it, but what are you trying to accomplish that you need help with?

@axmmisaka
Copy link
Collaborator

In .github/workflows/c-tests.yml

...
      runtime-ref:
        required: true
        type: string

...
      - name: Check out specific ref of reactor-c
        uses: actions/checkout@v3
        with:
          repository: lf-lang/reactor-c
          path: core/src/main/resources/lib/c/reactor-c
          # ref: ${{ inputs.runtime-ref }}
          ref: 'my_branch'
        if: ${{ inputs.runtime-ref }}
...

I think this part is where we should change, but it's not actually working. The if state should be true, which I changed it from the inputs.runtime-ref, and I don't know where I should point my branch.

I also tried just leaving ref: ${{ inputs.runtime-ref }} but still does not work.

You can either change ref here, or do this - change runtime-ref at the places where the reusable workflow is used.
https://github.com/axmmisaka/lingua-franca/pull/3/files#diff-364086986aaadd7d3fb584e3c7d09521d86c2525b711a2e1e0467de5c044486e
Either way, it's a pain......

@Jakio815
Copy link
Collaborator Author

@lhstrh The PR I'm working on is lf-lang/reactor-c#292. It was discussed in the security meeting.

If I know how to fix this issue, I'll update the README file.

@lhstrh
Copy link
Member

lhstrh commented Oct 25, 2023

I wasn't able to attend the security meeting this week. I'm pretty sure I can tell you how to fix the issue, but I don't know what the issue is. What are you trying to accomplish?

@Jakio815
Copy link
Collaborator Author

I wasn't able to attend the security meeting this week. I'm pretty sure I can tell you how to fix the issue, but I don't know what the issue is. What are you trying to accomplish?

Is this question still valid? I think you would've got it by the PR.
Or are you asking something else? Kind of didn't get your question.

@axmmisaka
Copy link
Collaborator

axmmisaka commented Oct 25, 2023

Hmm... I think your PR's CI is up and running? (Here, and in reactor-c)

@lhstrh
Copy link
Member

lhstrh commented Oct 25, 2023

You wrote:

I think this part is where we should change, but it's not actually working.
The if state should be true, which I changed it from the inputs.runtime-ref, and I don't know where I should point my branch.
I also tried just leaving ref: ${{ inputs.runtime-ref }} but still does not work.

I don't understand what you mean. What doesn't work? What are you trying to get to work?

@lhstrh
Copy link
Member

lhstrh commented Oct 25, 2023

Hmm... I think your PR's CI is up and running?

The PR @Jakio815 links to is in reactor-c, but he refers to docs in lingua-franca.

Generally, the way it works is that in lingua-franca, you update the submodule to point to the feature branch in reactor-c. In your feature branch in reactor-c, you update lingua-franca-ref.txt to get run CI with the desired version of the compiler.

@Jakio815
Copy link
Collaborator Author

Sorry for confusing everyone. Let me clarify.

I've got this PR lf-lang/reactor-c#292, which is moving net_util.c net_util.h net_common.h under a new directory network.
These files are under the repository reactor-c.

The problem is that because I also have to change the code generator, I also have to make a PR in the upper repository lingua-franca, and that PR is #2070.

The problem is that during the CI tests, in the lingua-franca directory doesn't seem to point the branch I made for in reactor-c.

Generally, the way it works is that in lingua-franca, you update the submodule to point to the feature branch in reactor-c. In your feature branch in reactor-c, you update lingua-franca-ref.txt to get run CI with the desired version of the compiler.

So, you mean we don't need to do the changing @master to @my-branch anymore?
In the lingua-franca repo, we just need to commit the changed submodule, and in the reactor-c, we only need to update lingua-franca-ref.txt as usual?

@axmmisaka
Copy link
Collaborator

axmmisaka commented Oct 25, 2023

In reactor-c repo, I believe changing lingua-franca-ref.txt is sufficient.

In the code generator repo, similarly, I think changing submodule reference will work in CI (I didn't check). If it doesn't, try my suggestion above - include the runtime-ref argument everywhere only-c is referenced (which will checkout reactor-c separately, I suppose). My understanding is that if a runtime-ref is supplied, then CI will checkout that version of runtime. Otherwise it will use the submodule. I misunderstood and I apologise.

I believe that your goal has nothing to do with ci.yml which doesn't exist anymore. You can find it in some of the legacy branches (such as this one, https://github.com/lf-lang/lingua-franca/blob/lfc/.github/workflows/ci.yml), it is meant as the "master" workflow that triggers a plethora of other reusable workflows. The documentation was meant to notify you, I suppose, that even if you start another branch, the @master inside it will still make trigger the reusable workflow at lingua-franca@master. It has nothing to do with the code generator code or runtime code, if you did not touch the CI workflow.

Yet I do agree that the documents are antiquated.

@Jakio815
Copy link
Collaborator Author

@axmmisaka Thanks for your help. So actually I only have to take care of lingua-franca-ref.txt. It took some time for me but it's much better than the way before we had to actually change things in the CI test.

@lhstrh
Copy link
Member

lhstrh commented Oct 26, 2023

It looks like your problem was resolved, @Jakio815, but the README hasn't been updated. Let's update it before closing this issue.

@lhstrh lhstrh reopened this Oct 26, 2023
@Jakio815
Copy link
Collaborator Author

Sorry! Just made a PR #2076.
I'm not sure if I should add the contents we discussed here: about how to make my submodule branch get applied to the lingua-franca repo's CI test.
The original docs actually only explained about how to change the workflow.
What do you think @lhstrh ?

@lhstrh
Copy link
Member

lhstrh commented Oct 27, 2023

Fixed in #2076.

@lhstrh lhstrh closed this as completed Oct 27, 2023
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

No branches or pull requests

3 participants