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

Explain how to test it on my repository #39

Closed
spl opened this issue Jun 29, 2020 · 16 comments
Closed

Explain how to test it on my repository #39

spl opened this issue Jun 29, 2020 · 16 comments
Assignees
Labels
enhancement New feature or request

Comments

@spl
Copy link

spl commented Jun 29, 2020

Is your feature request related to a problem? Please describe.

This project is a great idea! I'm hoping it will save me (and others) time/worry. But first, I'd like to test it out by triggering it on my repository.

Describe the solution you'd like

Can you explain how to, say, trigger action-update-license-year to determine if it worked correctly? If I want to use it, I'd like to know that it worked before January of next year.

Here's the kind of scenario I'm thinking about:

  1. I create a PR to my repo with an action that, when run immediately, will create a PR to update the copyright.
  2. Then, depending on whether action-update-license-year worked, I'm faced with a decision:
    • Satisfied, I go to 3.
    • Dissatisfied, I file a bug report with you and point you to my failed PR. Hopefully, the error is enough to help you fix any problem. Once fixed, I re-run action-update-license-year and return to 2.
  3. I change the action in my PR to schedule it as you've shown in your README.

Ideally, you could update your README with how to work through a scenario such as the above. This would help potential users other than myself. Thanks!

Describe alternatives you've considered

N/A

Additional context

N/A

@spl spl added the enhancement New feature or request label Jun 29, 2020
@github-actions
Copy link
Contributor

Hi there and welcome to this repository!

A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.

@FantasticFiasco
Copy link
Owner

I’ll see if I cannot create a repository for you, and I’ll see what I can do about the lacking documentation. I’ll get back to you when I get home from work.

@FantasticFiasco FantasticFiasco self-assigned this Jun 29, 2020
@FantasticFiasco
Copy link
Owner

Clearly there's not enough information in README.md, and I'll have to do a better job there, but until then this is what you can do to test the action.

Start with making sure that your current licence file is inaccurate, i.e. isn't specifying 2020. Then create a new workflow in your repository. The name of the YAML file is unimportant but you have to place it in the directory .github/workflows/. Add the following content to the file.

name: Update copyright year(s) in license file

on: push

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - name: Update license copyright year(s)
        uses: FantasticFiasco/action-update-license-year@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

A commit to your repository will trigger the action, and about a half of a minute after you pushed your code there should be a PR waiting for you. I just tested this in a new clean repo, you can find it here.

@spl
Copy link
Author

spl commented Jun 30, 2020

Fantastic! Thanks for the explanation.

I created a repository with only a README, added the action, and ran into an error:

Update license copyright year(s)1s
  Run FantasticFiasco/action-update-license-year@v1
    with:
      token: ***
##[error]Action failed with error: HttpError: Not Found

Let me know if I made a mistake somewhere.

@FantasticFiasco
Copy link
Owner

That might be an error on my part. I've only tested the action on repos with a LICENSE file in the root. Do you have a license file in your repo?

@spl
Copy link
Author

spl commented Jun 30, 2020

I just added a license.md to the same repository and encountered another error:

##[error]Action failed with error: HttpError: Reference already exists

@spl
Copy link
Author

spl commented Jun 30, 2020

Oh, right. I've recently started preferring license.md over LICENSE. The file content is nearly the same, however.

@FantasticFiasco
Copy link
Owner

... and ran into an error:

I've created #42 and will probably have time to look at it tonight.

@FantasticFiasco
Copy link
Owner

Oh, right. I've recently started preferring license.md over LICENSE. The file content is nearly the same, however.

Was the error due to the fact that the license file with name LICENSE still didn't exist, or because the PR was open. I'm not sure I've tested to run the action with an existing PR open.

Clearly I need to write more tests. I have good coverage at the code updating the license file, but am clearly lacking in the interaction with GitHub.

@FantasticFiasco
Copy link
Owner

Would you benefit from being able to configure the name of the license file? If so I'll create a new issue describing the feature request. You can also create it if you would like updates on the issue.

@spl
Copy link
Author

spl commented Jun 30, 2020

Would you benefit from being able to configure the name of the license file? If so I'll create a new issue describing the feature request. You can also create it if you would like updates on the issue.

Yes, I think that would be a useful feature. I'll create it, since I have another idea about it.

@FantasticFiasco
Copy link
Owner

I'm working towards fixing the reported bugs, but won't get there today. I'll continue to work on in the upcoming week. I'll get back to you when it's been done. Thank you for reporting the issue!

@spl
Copy link
Author

spl commented Jul 1, 2020

No problem! The next year is exactly 6 months away. 😉

@FantasticFiasco
Copy link
Owner

A new version has now been released, and let me start by apologizing for the time it took. I got sidetracked by simplifying my toolchain, and did a lot to improve the test. I think all bugs we've seen have been fixed.

When it comes to improving the documentation, i.e. this issue, that's my next task. Regarding improving the API and providing options for non-default repositories, e.g. mono-repos or as in your case where the license file is named differently, I think I will start with that after my summer vacation. I have a couple ideas, and will update the relevant issue when the time comes.

Until then, have a really nice summer and keep safe.

FantasticFiasco added a commit that referenced this issue Jul 18, 2020
Token is optional and should not be defined in the example. Let's
continue to improve the README.md in #39.
@FantasticFiasco
Copy link
Owner

FantasticFiasco commented Jul 18, 2020

TODO for improving the documentation:

  • Describe the API of the action
  • Describe a way to quickly test the action without having to wait until Jan 1, as defined by the example

FantasticFiasco added a commit that referenced this issue Jul 19, 2020
FantasticFiasco added a commit that referenced this issue Jul 19, 2020
FantasticFiasco added a commit that referenced this issue Jul 19, 2020
@FantasticFiasco
Copy link
Owner

I think the action is better described now, please have a look and give me your verdict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants