Giter Site home page Giter Site logo

github-actions-tester's Introduction

OCTOEVENTS WEBAPP

VERSIONS

  • FRAMEWORK: Rails V7

  • RUBY: 3.0.0

  • DB: MySQL

  • TESTING:

    • database-cleaner
    • factory_bot
    • faker
    • rspec
    • rubocop

STEPS TO TEST THE WEB APPLICATION

Run the following commands to set the web application environment:

  bundle install                        # Install gems
  rails db:create && rails db:migrate   # Create database and run the migrations
  rails s                               # Run the server
  rspec .                               # Run the tests

ROUTES

HTTP Route Description
POST /events This endpoint will receive the webhook issues information to create a record and also will save the events related to it if the issue has already been created.
GET /issues/{issue_number}/events Will display the events which belongs to the issue which is being searched.

CONFIGURE NGROK

Run ngrok and visit the localhost:4040 to gain access to the dashboard requests.

  sudo ngrok http 3000

This will open a screen like the following:

  ngrok by @inconshreveable                                                 (Ctrl+C to quit)
                                                                                            
  Session Status                online                                                      
  Account                       William Romero (Plan: Free)                                 
  Version                       2.3.40                                                      
  Region                        United States (us)                                          
  Web Interface                 http://127.0.0.1:4040                                       
  Forwarding                    http://e850-2800-98-1211-3601-403a-6e57-fbb8-d1f2.ngrok.io -
  Forwarding                    https://e850-2800-98-1211-3601-403a-6e57-fbb8-d1f2.ngrok.io 
                                                                                            
  Connections                   ttl     opn     rt1     rt5     p50     p90                 
                                14      0       0.00    0.00    20.30   23.34               
                                                                                            
  HTTP Requests                                                                             
  -------------

Copy the second URL and copy inside Github, following this instructions.

  1. On Github > Settings > Webhooks
  2. Click on Add webhook
  3. On Payload URL field, insert the Ngrok public endpoint finished by /events.
  https://e850-2800-98-1211-3601-403a-6e57-fbb8-d1f2.ngrok.io/events
  1. On the Content type field, select the option application/json.
  2. After that, check which actions is needed to trigger on this webapp. In our current project, the issue events are filtered, what refuses if actions are not related with issues.
  3. Check the Active checkbox to let the webhook deliver details about the event.
  4. Click on Add webhook.

Note: Each time the Ngrok process is closed, the subdomain of that tool will change, so is needed to change this address into Github settings webhook page and also inside the project on the development.rb environment file.

  # config.hosts << ENV['NGROK_HOST'] if ENV['NGROK_HOST'].present?
  config.hosts << "e850-2800-98-1211-3601-403a-6e57-fbb8-d1f2.ngrok.io"

github-actions-tester's People

Contributors

williamromero avatar

Watchers

James Cloos avatar  avatar

github-actions-tester's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.